diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c3bc9cd9..894692f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,10 +1,10 @@ name: Publish Docker image on: - release: - types: [ published ] + push: + branches: [ master ] jobs: publish: - name: Push Docker image to GitHub Packages + name: Publish to GitHub Packages runs-on: ubuntu-latest steps: - name: Checkout repository @@ -16,5 +16,4 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} registry: docker.pkg.github.com repository: lowlighter/metrics/metrics - tag_with_ref: true - + tag_with_ref: true \ No newline at end of file diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index c67f1743..83c4316b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -35,20 +35,3 @@ jobs: config-file: ./.github/config/codeql.yml - name: Analyze code uses: github/codeql-action/analyze@v1 - - publish: - name: Publish to GitHub Packages - runs-on: ubuntu-latest - needs: [ build, analyze ] - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - 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 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 763aaa8f..371142c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,10 @@ +# This is the base image used by metrics, without metrics source files + # Base image FROM node:15-buster-slim -# Copy repository -COPY . /metrics - # Setup -RUN chmod +x /metrics/source/app/action/index.mjs \ +RUN mkdir /metrics \ # 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 && apt-get update \ @@ -25,11 +24,5 @@ RUN chmod +x /metrics/source/app/action/index.mjs \ # Install python for node-gyp && apt-get update \ && apt-get install -y python3 \ - # Install node modules - && cd /metrics \ - && npm ci ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true ENV PUPPETEER_BROWSER_PATH "google-chrome-stable" - -# Execute GitHub action -ENTRYPOINT node /metrics/source/app/action/index.mjs \ No newline at end of file diff --git a/action.yml b/action.yml index 8f10025d..509b0ca3 100644 --- a/action.yml +++ b/action.yml @@ -1,4 +1,4 @@ -# Action +# Action metadata name: GitHub metrics as SVG image author: lowlighter description: Generate an user's GitHub metrics as SVG image format to embed somewhere else @@ -9,7 +9,7 @@ runs: using: docker image: Dockerfile -# Inputs +# Inputs and configuration inputs: # Personal user token