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 and Publish Container Image
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+ permissions :
13+ contents : read
14+ packages : write
15+ steps :
16+ - name : Checkout repository
17+ uses : actions/checkout@v4
18+
19+ - name : Set up QEMU
20+ uses : docker/setup-qemu-action@v3
21+
22+ - name : Set up Docker Buildx
23+ uses : docker/setup-buildx-action@v3
24+
25+ - name : Extract version
26+ id : vars
27+ run : echo "VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV
28+
29+ - name : Log in to ghcr
30+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
31+ uses : docker/login-action@v3
32+ with :
33+ registry : ghcr.io
34+ username : ${{ github.actor }}
35+ password : ${{ secrets.GITHUB_TOKEN }}
36+
37+ - name : Build and push Docker image
38+ uses : docker/build-push-action@v5
39+ with :
40+ context : .
41+ file : Dockerfile
42+ push : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
43+ tags : |
44+ ghcr.io/${{ github.repository_owner }}/delve:${{ env.VERSION }}
45+ ghcr.io/${{ github.repository_owner }}/delve:latest
46+ cache-from : type=gha
47+ cache-to : type=gha,mode=max
You can’t perform that action at this time.
0 commit comments