-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathaction.yml
45 lines (42 loc) · 1.43 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Metrics embed
author: lowlighter
description: An infographics generator with 40+ plugins and 300+ options to display stats about your GitHub account!
branding:
icon: user-check
color: gray-dark
inputs:
docker_image:
description: Docker image to use
default: ghcr.io/lowlighter/metrics:v4
required: true
config:
description: Configuration file
default: metrics.config.yml
required: true
outputs:
result:
description: Result of the action
runs:
using: composite
steps:
- uses: actions/checkout@v3
- uses: denoland/setup-deno@v1
- shell: bash
env:
INPUTS: ${{ toJson(inputs) }}
run: |
echo "::group::Metrics docker image setup"
echo "GitHub action: $(echo '${{ github.action }}' | tr '_' '/')"
cd ${{ github.action_path }}
DOCKER_IMAGE="${{ inputs.docker_image }}"
if [ -f "$DOCKER_IMAGE" ]; then
DOCKER_LOCAL=metrics:local
echo "Using local docker image: $DOCKER_IMAGE"
deno task make docker --tag $DOCKER_LOCAL --file $DOCKER_IMAGE
DOCKER_IMAGE=$DOCKER_LOCAL
else
echo "Pulling remote docker image: $DOCKER_IMAGE"
docker pull $DOCKER_IMAGE
fi
echo "::endgroup::"
docker run --tty --env-file <(env | grep -E 'GITHUB|CI|TZ') --env INPUTS --rm --volume ${{ github.workspace }}:/workspace --volume /metrics_renders:/metrics_renders $DOCKER_IMAGE run