diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 894692f1..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Publish Docker image -on: - push: - branches: [ master ] -jobs: - publish: - name: Publish to GitHub Packages - runs-on: ubuntu-latest - 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 92c9c6e4..8aa44e47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,30 +1,14 @@ -# This is the base image used by metrics, without metrics source files - # Base image -FROM node:15-buster-slim +FROM docker.pkg.github.com/lowlighter/metrics/metrics:latest + +# Copy repository +COPY . /metrics # Setup -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 \ - && apt-get install -y wget gnupg ca-certificates libgconf-2-4 \ - && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ - && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ - && apt-get update \ - && apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \ - --no-install-recommends \ - && rm -rf /var/lib/apt/lists/* \ - # Install ruby to support linguist - # Based on https://github.com/github/linguist - && apt-get update \ - && apt-get install -y ruby-full \ - && apt-get install -y git g++ cmake pkg-config libicu-dev zlib1g-dev libcurl4-openssl-dev libssl-dev ruby-dev \ - && gem install github-linguist \ - # Install python for node-gyp - && apt-get update \ - && apt-get install -y python3 +RUN chmod +x /metrics/source/app/action/index.mjs \ + # Install node modules + && cd /metrics \ + && npm ci -# Environment variables -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/source/docker/Dockerfile b/source/docker/Dockerfile new file mode 100644 index 00000000..92c9c6e4 --- /dev/null +++ b/source/docker/Dockerfile @@ -0,0 +1,30 @@ +# This is the base image used by metrics, without metrics source files + +# Base image +FROM node:15-buster-slim + +# Setup +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 \ + && apt-get install -y wget gnupg ca-certificates libgconf-2-4 \ + && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ + && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ + && apt-get update \ + && apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* \ + # Install ruby to support linguist + # Based on https://github.com/github/linguist + && apt-get update \ + && apt-get install -y ruby-full \ + && apt-get install -y git g++ cmake pkg-config libicu-dev zlib1g-dev libcurl4-openssl-dev libssl-dev ruby-dev \ + && gem install github-linguist \ + # Install python for node-gyp + && apt-get update \ + && apt-get install -y python3 + +# Environment variables +ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true +ENV PUPPETEER_BROWSER_PATH "google-chrome-stable"