File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build Image
2+
3+ on :
4+ push :
5+ branches : [main]
6+ paths :
7+ - build/fpm.Dockerfile
8+ - .github/workflows/image.yml
9+ workflow_dispatch :
10+
11+ jobs :
12+
13+ build :
14+
15+ name : Build and push image
16+ runs-on : ubuntu-latest
17+ timeout-minutes : 20
18+
19+ permissions :
20+ contents : read
21+ packages : write
22+
23+ steps :
24+
25+ - name : Checkout code
26+ uses : actions/checkout@v6
27+
28+ - name : Log in to GHCR
29+ uses : docker/login-action@v3
30+ with :
31+ registry : ghcr.io
32+ username : ${{ github.actor }}
33+ password : ${{ secrets.GITHUB_TOKEN }}
34+
35+ - name : Set up Buildx
36+ uses : docker/setup-buildx-action@v3
37+
38+ - name : Build and push
39+ uses : docker/build-push-action@v6
40+ with :
41+ context : build
42+ file : build/fpm.Dockerfile
43+ push : true
44+ tags : ghcr.io/${{ github.repository_owner }}/fpm:latest
Original file line number Diff line number Diff line change @@ -20,10 +20,10 @@ jobs:
2020 - name : Checkout code
2121 uses : actions/checkout@v6
2222
23- - name : Build the Docker image
23+ - name : Pull the Docker image
2424 run : |
25- cd build
26- docker build . --tag fpm --file fpm.Dockerfile
25+ docker pull ghcr.io/${{ github.repository_owner }}/fpm:latest
26+ docker tag ghcr.io/${{ github.repository_owner }}/ fpm:latest fpm
2727
2828 - name : Bundle packages
2929 run : |
You can’t perform that action at this time.
0 commit comments