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 : CI
2+ on :
3+ push :
4+ branches : [main]
5+ pull_request :
6+ branches : [main]
7+ jobs :
8+ build :
9+ if : github.ref == 'refs/heads/main' && github.event_name == 'push'
10+ runs-on : ubuntu-latest
11+ env :
12+ REGISTRY : ghcr.io
13+ IMAGE_NAME : ${{ github.repository }}
14+ permissions :
15+ contents : read
16+ packages : write
17+ attestations : write
18+ id-token : write
19+ steps :
20+ - uses : actions/checkout@v6
21+
22+ - name : Docker Login
23+ uses : docker/login-action@v3
24+ with :
25+ registry : ${{ env.REGISTRY }}
26+ username : ${{ github.actor }}
27+ password : ${{ secrets.GITHUB_TOKEN }}
28+
29+ - name : Set up Docker Buildx
30+ uses : docker/setup-buildx-action@v3
31+
32+ - name : Extract metadata (tags, labels) for Docker
33+ id : meta
34+ uses : docker/metadata-action@v5
35+ with :
36+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
37+
38+ - name : Build and push Docker image
39+ id : push
40+ uses : docker/build-push-action@v6
41+ with :
42+ context : .
43+ file : ./Dockerfile
44+ push : true
45+ tags : ${{ steps.meta.outputs.tags }}
46+ labels : ${{ steps.meta.outputs.labels }}
47+ platforms : linux/amd64,linux/arm64
You can’t perform that action at this time.
0 commit comments