1
1
name : Build and Push Docker Image to GHCR
2
2
3
- on : push
3
+ on :
4
+ push :
5
+ branches :
6
+ - ' master'
7
+ pull_request :
4
8
5
- permissions :
6
- contents : read # Required to checkout the repo code
7
- packages : write # Required to push packages to GHCR
9
+ permissions : {}
8
10
9
11
jobs :
10
12
xcp-ng-build-env-82 :
11
13
runs-on : ubuntu-latest
14
+ permissions :
15
+ packages : write # Required to push packages to GHCR
12
16
steps :
13
17
- uses : actions/checkout@v4
14
- - uses : docker/setup-buildx-action@v3
18
+ with :
19
+ persist-credentials : false
20
+ - uses : docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
15
21
with :
16
22
driver : docker-container
17
- - uses : docker/login-action@v3
23
+ - uses : docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1
18
24
if : github.ref == 'refs/heads/master'
19
25
with :
20
26
registry : ghcr.io
21
27
username : ${{ github.actor }} # Uses the GitHub user/org name that triggered the workflow
22
28
password : ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub
23
- - uses : docker/build-push-action@v5 # Using v5 for latest features
29
+ - uses : docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
24
30
with :
25
31
context : ./src/xcp_ng_dev/
26
32
file : ./src/xcp_ng_dev/files/Dockerfile-8.x
@@ -35,18 +41,23 @@ jobs:
35
41
36
42
xcp-ng-build-env-83 :
37
43
runs-on : ubuntu-latest
44
+ permissions :
45
+ packages : write # Required to push packages to GHCR
38
46
steps :
39
47
- uses : actions/checkout@v4
40
- - uses : docker/setup-buildx-action@v3
48
+ with :
49
+ persist-credentials : false
50
+ - uses : docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
41
51
with :
42
52
driver : docker-container
43
- - uses : docker/login-action@v3
53
+ - uses : docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1
44
54
if : github.ref == 'refs/heads/master'
45
55
with :
46
56
registry : ghcr.io
47
57
username : ${{ github.actor }} # Uses the GitHub user/org name that triggered the workflow
48
58
password : ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub
49
- - uses : docker/build-push-action@v5 # Using v5 for latest features
59
+ - run : echo "VERSION=$(cat ./src/xcp_ng_dev/files/protocol-version.txt | tr -d '\n')" >> $GITHUB_ENV
60
+ - uses : docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
50
61
with :
51
62
context : ./src/xcp_ng_dev/
52
63
file : ./src/xcp_ng_dev/files/Dockerfile-8.x
@@ -60,18 +71,22 @@ jobs:
60
71
# TODO: uncomment once we have a public xcp-ng 9.0 repository
61
72
# xcp-ng-build-env-90:
62
73
# runs-on: ubuntu-latest
74
+ # permissions:
75
+ # packages: write # Required to push packages to GHCR
63
76
# steps:
64
77
# - uses: actions/checkout@v4
65
- # - uses: docker/setup-buildx-action@v3
78
+ # with:
79
+ # persist-credentials: false
80
+ # - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
66
81
# with:
67
82
# driver: docker-container
68
- # - uses: docker/login-action@v3
83
+ # - uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1
69
84
# if: github.ref == 'refs/heads/master'
70
85
# with:
71
86
# registry: ghcr.io
72
87
# username: ${{ github.actor }} # Uses the GitHub user/org name that triggered the workflow
73
88
# password: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub
74
- # - uses: docker/build-push-action@v5 # Using v5 for latest features
89
+ # - uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
75
90
# with:
76
91
# context: ./src/xcp_ng_dev/
77
92
# file: ./src/xcp_ng_dev/files/Dockerfile-9.x
0 commit comments