File tree Expand file tree Collapse file tree 2 files changed +51
-2
lines changed
Expand file tree Collapse file tree 2 files changed +51
-2
lines changed Original file line number Diff line number Diff line change 1- name : Docker Build
1+ name : Build Image
22
33on :
4- push :
4+ workflow_call :
55 workflow_dispatch :
66
77jobs :
4545 uses : docker/build-push-action@v6
4646 with :
4747 push : true
48+ labels : ${{ steps.meta.outputs.labels }}
4849 tags : ${{ steps.meta.outputs.tags }}
4950
5051 test :
Original file line number Diff line number Diff line change 1+ name : Tag Image
2+
3+ on :
4+ workflow_call :
5+ workflow_dispatch :
6+
7+ jobs :
8+ tag :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Checkout code
12+ uses : actions/checkout@v4
13+
14+ - name : Set up QEMU
15+ uses : docker/setup-qemu-action@v3
16+
17+ - name : Set up Docker Buildx
18+ uses : docker/setup-buildx-action@v3
19+
20+ - name : Login to GitHub Container Registry
21+ uses : docker/login-action@v3
22+ with :
23+ registry : ghcr.io
24+ username : ${{ github.actor }}
25+ password : ${{ secrets.GITHUB_TOKEN }}
26+
27+ - name : Determine long-lived Docker image tags
28+ id : meta
29+ uses : docker/metadata-action@v5
30+ with :
31+ images : ghcr.io/${{ github.repository }}
32+ tags : |
33+ type=sha
34+ type=ref,event=branch
35+ type=ref,event=tag
36+ type=semver,pattern={{major}}
37+ type=semver,pattern={{major}}.{{minor}}
38+ type=semver,pattern={{version}}
39+ type=raw,value=latest,enable={{is_default_branch}}
40+
41+ - name : Retag and push the image
42+ uses : docker/build-push-action@v2
43+ with :
44+ push : true
45+ labels : ${{ steps.meta.outputs.labels }}
46+ tags : ${{ steps.meta.outputs.tags }}
47+ cache-from : type=registry,ref=${{ github.repository }}
48+ cache-to : type=inline
You can’t perform that action at this time.
0 commit comments