forked from dyninst/dyninst
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (85 loc) · 2.66 KB
/
refresh-containers.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Refresh base and dev containers
on:
schedule:
- cron: '0 3 25 * *' # 3AM on the 25th of every month
workflow_dispatch:
jobs:
get-oses:
runs-on: ubuntu-latest
outputs:
all: ${{ steps.all.outputs.all }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: all
uses: ./.github/actions/os-versions
purge:
runs-on: ubuntu-latest
needs: get-oses
strategy:
fail-fast: false
matrix:
os: ${{ fromJson(needs.get-oses.outputs.all) }}
permissions:
packages: write
name: Purge ${{ matrix.os }}
steps:
- name: Development containers
uses: actions/delete-package-versions@v5
with:
package-name: amd64/${{ matrix.os }}
package-type: "container"
token: ${{ secrets.github_token }}
min-versions-to-keep: 0
delete-only-untagged-versions: "true"
- name: Base containers
uses: actions/delete-package-versions@v5
with:
package-name: amd64/${{ matrix.os }}-base
package-type: "container"
token: ${{ secrets.github_token }}
min-versions-to-keep: 0
delete-only-untagged-versions: "true"
build-base:
runs-on: ubuntu-latest
needs: [get-oses, purge]
strategy:
fail-fast: false
matrix:
os: ${{ fromJson(needs.get-oses.outputs.all) }}
permissions:
packages: write
name: Update base containers
steps:
- uses: actions/checkout@v4
- name: GHCR Login
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- shell: bash
run: |
set -ex
readarray -d "-" -t array <<< "${{ matrix.os }}"
distro=${array[0]}
version=$(echo ${array[1]} | sed 's/ //g')
extra=
if test "${{ matrix.os }}" = "ubuntu-20.04"; then
extra="--build-arg build_elfutils=yes"
fi
base="ghcr.io/dyninst/amd64/${distro}-${version}-base:latest"
# Always use latest distro image; ignoring any cached versions
docker pull ${distro}:${version}
docker build -f docker/Dockerfile.${distro} \
-t $base \
--build-arg build_jobs=2 \
--build-arg version=${version} \
${extra} \
.
docker push ${base}
build-deploy-dev:
needs: build-base
uses: ./.github/workflows/dev-containers.yaml
permissions:
packages: write