-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (60 loc) · 2.03 KB
/
build.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
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
name: build
on:
push:
branches:
- main
pull_request:
merge_group:
schedule:
- cron: '0 2 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
env:
DRY_RUN: ${{ github.ref != 'refs/heads/main' }}
HUSKY: 0
SKOPEO_VERSION: 1.16.1 # renovate: datasource=github-releases depName=skopeo packageName=visualon/skopeo-prebuild versioning=semver
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: corepack enable
- run: pnpm install
- run: pnpm prettier
build:
needs:
- lint
runs-on: ubuntu-latest
permissions:
id-token: write
packages: write
strategy:
fail-fast: false
matrix:
tag:
- 20.04
- 22.04
- 24.04
- latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
- name: install skopeo v${{ env.SKOPEO_VERSION }}
run: |
tmp_dir="$(mktemp -d)"
curl -sSLf "https://github.com/visualon/skopeo-prebuild/releases/download/${{ env.SKOPEO_VERSION }}/skopeo-${{ env.SKOPEO_VERSION }}-x86_64.tar.xz" -o "${tmp_dir}/skopeo.tar.xz"
tar --strip 2 -xf "${tmp_dir}/skopeo.tar.xz"
ls -la .
- name: Docker registry login
if: env.DRY_RUN == 'false'
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- name: Publish ${{matrix.tag}} to ghcr.io
if: env.DRY_RUN == 'false'
run: |
./skopeo copy --multi-arch all --digestfile=digest.txt docker://docker.io/library/ubuntu:${{matrix.tag}} docker://ghcr.io/${{ github.repository }}:${{matrix.tag}}
cosign sign -y "ghcr.io/${{ github.repository }}@$(cat digest.txt)"