File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Build and Push Docker Image
22
33on :
4- push :
5- branches :
6- - main
7- tags :
8- - " v*"
4+ workflow_run :
5+ workflows : ["golangci-lint"]
6+ types :
7+ - completed
98
109jobs :
1110 build-and-push :
1211 runs-on : ubuntu-latest
1312
13+ # Only run if lint workflow succeeded
14+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
15+
1416 permissions :
1517 contents : read
1618 packages : write
1719
1820 steps :
1921 - name : Checkout repository
2022 uses : actions/checkout@v4
23+ with :
24+ # Required when using workflow_run trigger
25+ ref : ${{ github.event.workflow_run.head_sha }}
2126
2227 - name : Set up Docker Buildx
2328 uses : docker/setup-buildx-action@v3
3439 uses : docker/metadata-action@v5
3540 with :
3641 images : ghcr.io/${{ github.repository }}
42+ tags : |
43+ type=sha
44+ type=ref,event=branch
45+ type=raw,value=latest,enable={{is_default_branch}}
3746
3847 - name : Build and push image
3948 uses : docker/build-push-action@v5
You can’t perform that action at this time.
0 commit comments