-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (39 loc) · 1.04 KB
/
docker-run.yaml
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
name: Docker Run
on:
workflow_call:
inputs:
PROJECT:
type: string
required: true
COMMAND:
type: string
required: true
jobs:
docker-run:
runs-on: ubuntu-22.04
steps:
- name: lowercase things
id: lowercase
env:
project: ${{inputs.PROJECT}}
run: |
echo "project=${project,,}" >> "$GITHUB_OUTPUT"
- name: download a build artifact
uses: actions/[email protected]
id: download
with:
name: artifacts_image_${{inputs.PROJECT}}
- name: load image
id: image_ids
run: |
{
echo 'ids<<EOF'
docker image load --input image_${{steps.lowercase.outputs.project}}.tar | sed 's/Loaded image: //g'
echo EOF
} >> $GITHUB_OUTPUT
- name: docker run
id: run
run: |
TAGS="${{steps.image_ids.outputs.ids}}"
TRIMMED_TAG=$(echo $TAGS | cut -d' ' -f1)
docker run --rm ${TRIMMED_TAG} ${{inputs.COMMAND}}