File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,43 @@ name: Image Publishing
22
33on :
44 push :
5+ # Run only on release pushes
56 tags :
67 - v*
8+ # but all PRs
9+ pull_request :
710
811jobs :
912 build :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout
16+ uses : actions/checkout@v4
17+
18+ - name : Set up Docker Buildx
19+ uses : docker/setup-buildx-action@v3
20+
21+ - name : Build image
22+ uses : docker/build-push-action@v5
23+ with :
24+ context : .
25+ cache-from : type=gha
26+ cache-to : type=gha
27+ tags : ci_test
28+
29+ - name : Login to GHCR
30+ if : ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
31+ uses : docker/login-action@v3
32+ with :
33+ registry : ghcr.io/${{ github.repository_owner }}
34+ username : ${{ github.actor }}
35+ password : ${{ secrets.GITHUB_TOKEN }}
36+
37+ - name : Publish image
38+ if : ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
39+ uses : docker/build-push-action@v5
40+ with :
41+ context : .
42+ tags : ${{ github.ref_name }}
43+ cache-from : type=gha
44+ push : true
You can’t perform that action at this time.
0 commit comments