-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (55 loc) · 1.8 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
name: build
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
env:
DRY_RUN: ${{ github.ref_name != 'main' }}
OWNER: ${{ github.repository_owner }}
PLATFORMS: linux/amd64,linux/arm64
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
packages: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: sigstore/cosign-installer@1fc5bd396d372bee37d608f955b336615edf79c8 # v3.2.0
- name: Docker registry login
if: env.DRY_RUN == 'false'
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ env.OWNER }} --password-stdin
- name: Publish to ghcr.io
uses: containerbase/internal-tools@7401e4de7d6a38ab36a92b5efffe323105d342a3 # v3.0.29
with:
command: docker-builder
image-prefix: ghcr.io/${{ env.OWNER }}
platforms: ${{ env.PLATFORMS }}
last-only: true
major-minor: false
dry-run: ${{ env.DRY_RUN }}
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Init
run: ./bin/init.sh
- uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
if: env.DRY_RUN == 'false'
with:
allowUpdates: true
body: See https://github.com/containerbase/base/releases/tag/${{ env.VERSION }} for more changes
commit: ${{ github.sha }}
name: ${{ env.VERSION }}
tag: v${{ env.VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}