Create base docker image

This commit is contained in:
linguist
2020-12-30 21:20:27 +01:00
parent b5720b6990
commit e9c2a36853
4 changed files with 9 additions and 34 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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