File tree Expand file tree Collapse file tree 1 file changed +35
-3
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +35
-3
lines changed
Original file line number Diff line number Diff line change 10
10
- slides/**
11
11
- images/**
12
12
- .gitignore
13
+ pull_request :
14
+ paths-ignore :
15
+ - " *.md"
16
+ - slides/**
17
+ - images/**
18
+ - .gitignore
13
19
workflow_dispatch :
14
20
15
21
jobs :
16
22
build-and-push :
17
23
runs-on : ubuntu-latest
18
24
permissions :
19
25
packages : write
26
+ strategy :
27
+ matrix :
28
+ arch : [amd64, arm64]
29
+ fail-fast : false
20
30
steps :
31
+ - name : Checkout code
32
+ uses : actions/checkout@v4
33
+
34
+ - name : Set up QEMU
35
+ uses : docker/setup-qemu-action@v3
36
+
21
37
- name : Setup Docker Buildx
22
38
uses : docker/setup-buildx-action@v3
23
39
24
40
- name : Log in to GHCR
41
+ if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
25
42
uses : docker/login-action@v3
26
43
with :
27
44
registry : ghcr.io
28
45
username : ${{ github.actor }}
29
46
password : ${{ secrets.GITHUB_TOKEN }}
30
47
48
+ - name : Docker meta
49
+ id : meta
50
+ uses : docker/metadata-action@v5
51
+ with :
52
+ images : ghcr.io/${{ github.repository }}
53
+ tags : |
54
+ type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' && matrix.arch == 'amd64' }}
55
+ type=ref,event=branch
56
+ type=ref,event=pr
57
+ type=sha,format=short
58
+ flavor : |
59
+ suffix=-${{ matrix.arch }}
60
+
31
61
- name : Build and push
32
62
uses : docker/build-push-action@v6
33
63
with :
34
- platforms : linux/amd64,linux/arm64
35
- push : true
36
- tags : ghcr.io/${{ github.repository }}:latest
64
+ context : .
65
+ platforms : linux/${{ matrix.arch }}
66
+ push : ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
67
+ tags : ${{ steps.meta.outputs.tags }}
68
+ labels : ${{ steps.meta.outputs.labels }}
You can’t perform that action at this time.
0 commit comments