File tree Expand file tree Collapse file tree 2 files changed +34
-42
lines changed
Expand file tree Collapse file tree 2 files changed +34
-42
lines changed Original file line number Diff line number Diff line change 1+ name : Docker Build and Push
2+ on :
3+ push :
4+ tags :
5+ - ' *'
6+
7+ jobs :
8+ build :
9+ name : Build and push to GitHub Container Registry
10+ runs-on : ubuntu-22.04
11+ permissions :
12+ contents : read
13+ packages : write
14+ steps :
15+ - name : Set VERSION and TAG
16+ run : |
17+ echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
18+ echo "VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
19+
20+ - uses : actions/checkout@v4
21+
22+ - name : Login to GitHub Container Registry
23+ run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.repository_owner }}" --password-stdin
24+
25+ - name : Setup Docker buildx
26+ run : docker buildx create --use
27+
28+ - name : Run Docker buildx
29+ run : |
30+ docker buildx build \
31+ --platform linux/amd64,linux/arm64 \
32+ --build-arg VERSION=${{ env.VERSION }} \
33+ --tag ghcr.io/${{ github.repository }}:${{ env.TAG }} \
34+ --push .
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments