-
-
Notifications
You must be signed in to change notification settings - Fork 7
61 lines (50 loc) · 1.65 KB
/
build-docker-runner-node.yml
File metadata and controls
61 lines (50 loc) · 1.65 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Build Runner Docker Image Node
on:
workflow_call:
inputs:
node-version:
required: false
default: '18.x'
type: string
git-revision:
required: false
default: ${{ github.sha }}
type: string
jobs:
build-docker-runner-node-image:
name: Build runner docker image (Nodejs ${{ inputs.node-version }})
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.git-revision }}
- name: Setup Nodejs ${{ inputs.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
- name: Install dependencies
run: yarn install --ignore-engines --frozen-lockfile --prefer-offline
- name: Prebuild packages
run: scripts/run-script.js --scope packages/runner prebuild:docker
- name: Build image
run: docker build -t scramjetorg/runner:$(git rev-parse HEAD) -f Dockerfile ../../
working-directory: packages/runner
- name: Export image
run: >
docker images |
awk '/scramjet/{print $1,$2,$3}' |
sed 's|/| |' |
while read repo name tag id; do
docker save $repo/$name:$tag -o $repo-$name-$tag-node-${{ inputs.node-version }}-docker-image.tar
done
- name: Install pigz and zip image
run: |
sudo apt-get install pigz -y
pigz *-docker-image.tar
- name: Upload image as an artifact
uses: actions/upload-artifact@v3
with:
name: runner-node-image
path: '*.tar.gz'
retention-days: 1