Update docker process [rebuild docker image]
This commit is contained in:
18
.github/workflows/workflow.yml
vendored
18
.github/workflows/workflow.yml
vendored
@@ -10,6 +10,24 @@ on:
|
|||||||
- '**/*.png'
|
- '**/*.png'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
docker:
|
||||||
|
name: Update GitHub Packages
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, '[rebuild docker image]')
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Publish image to GitHub Packages
|
||||||
|
uses: docker/build-push-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
registry: docker.pkg.github.com
|
||||||
|
repository: lowlighter/metrics/metrics
|
||||||
|
tag_with_ref: true
|
||||||
|
dockerfile: source/docker/Dockerfile
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build and test
|
name: Build and test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -4,11 +4,5 @@ FROM docker.pkg.github.com/lowlighter/metrics/metrics:latest
|
|||||||
# Copy repository
|
# Copy repository
|
||||||
COPY . /metrics
|
COPY . /metrics
|
||||||
|
|
||||||
# Setup
|
|
||||||
RUN chmod +x /metrics/source/app/action/index.mjs \
|
|
||||||
# Install node modules
|
|
||||||
&& cd /metrics \
|
|
||||||
&& npm ci
|
|
||||||
|
|
||||||
# Execute GitHub action
|
# Execute GitHub action
|
||||||
ENTRYPOINT node /metrics/source/app/action/index.mjs
|
ENTRYPOINT node /metrics/source/app/action/index.mjs
|
||||||
@@ -3,8 +3,11 @@
|
|||||||
# Base image
|
# Base image
|
||||||
FROM node:15-buster-slim
|
FROM node:15-buster-slim
|
||||||
|
|
||||||
|
# Copy package.json
|
||||||
|
COPY . /metrics/package.json
|
||||||
|
|
||||||
# Setup
|
# Setup
|
||||||
RUN mkdir /metrics \
|
RUN cd /metrics \
|
||||||
# Install latest chrome dev package, fonts to support major charsets and skip chromium download on puppeteer install
|
# Install latest chrome dev package, fonts to support major charsets and skip chromium download on puppeteer install
|
||||||
# Based on https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker
|
# Based on https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
@@ -23,7 +26,9 @@ RUN mkdir /metrics \
|
|||||||
&& gem install github-linguist \
|
&& gem install github-linguist \
|
||||||
# Install python for node-gyp
|
# Install python for node-gyp
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& apt-get install -y python3
|
&& apt-get install -y python3 \
|
||||||
|
# Install node modules
|
||||||
|
&& npm ci
|
||||||
|
|
||||||
# Environment variables
|
# Environment variables
|
||||||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
|
||||||
|
|||||||
Reference in New Issue
Block a user