Create base docker image
This commit is contained in:
7
.github/workflows/release.yml
vendored
7
.github/workflows/release.yml
vendored
@@ -1,10 +1,10 @@
|
|||||||
name: Publish Docker image
|
name: Publish Docker image
|
||||||
on:
|
on:
|
||||||
release:
|
push:
|
||||||
types: [ published ]
|
branches: [ master ]
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
name: Push Docker image to GitHub Packages
|
name: Publish to GitHub Packages
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -17,4 +17,3 @@ jobs:
|
|||||||
registry: docker.pkg.github.com
|
registry: docker.pkg.github.com
|
||||||
repository: lowlighter/metrics/metrics
|
repository: lowlighter/metrics/metrics
|
||||||
tag_with_ref: true
|
tag_with_ref: true
|
||||||
|
|
||||||
|
|||||||
17
.github/workflows/workflow.yml
vendored
17
.github/workflows/workflow.yml
vendored
@@ -35,20 +35,3 @@ jobs:
|
|||||||
config-file: ./.github/config/codeql.yml
|
config-file: ./.github/config/codeql.yml
|
||||||
- name: Analyze code
|
- name: Analyze code
|
||||||
uses: github/codeql-action/analyze@v1
|
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
|
|
||||||
13
Dockerfile
13
Dockerfile
@@ -1,11 +1,10 @@
|
|||||||
|
# This is the base image used by metrics, without metrics source files
|
||||||
|
|
||||||
# Base image
|
# Base image
|
||||||
FROM node:15-buster-slim
|
FROM node:15-buster-slim
|
||||||
|
|
||||||
# Copy repository
|
|
||||||
COPY . /metrics
|
|
||||||
|
|
||||||
# Setup
|
# 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
|
# 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 \
|
||||||
@@ -25,11 +24,5 @@ RUN chmod +x /metrics/source/app/action/index.mjs \
|
|||||||
# 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
|
|
||||||
&& cd /metrics \
|
|
||||||
&& npm ci
|
|
||||||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
|
||||||
ENV PUPPETEER_BROWSER_PATH "google-chrome-stable"
|
ENV PUPPETEER_BROWSER_PATH "google-chrome-stable"
|
||||||
|
|
||||||
# Execute GitHub action
|
|
||||||
ENTRYPOINT node /metrics/source/app/action/index.mjs
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Action
|
# Action metadata
|
||||||
name: GitHub metrics as SVG image
|
name: GitHub metrics as SVG image
|
||||||
author: lowlighter
|
author: lowlighter
|
||||||
description: Generate an user's GitHub metrics as SVG image format to embed somewhere else
|
description: Generate an user's GitHub metrics as SVG image format to embed somewhere else
|
||||||
@@ -9,7 +9,7 @@ runs:
|
|||||||
using: docker
|
using: docker
|
||||||
image: Dockerfile
|
image: Dockerfile
|
||||||
|
|
||||||
# Inputs
|
# Inputs and configuration
|
||||||
inputs:
|
inputs:
|
||||||
|
|
||||||
# Personal user token
|
# Personal user token
|
||||||
|
|||||||
Reference in New Issue
Block a user