1+ # This workflow uses actions that are not certified by GitHub.
2+ # They are provided by a third-party and are governed by
3+ # separate terms of service, privacy policy, and support
4+ # documentation.
5+
6+ name : publish image to ghrc.io
7+
8+ on :
9+ push :
10+ branches :
11+ - main
12+ tags :
13+ - ' *'
14+
15+ jobs :
16+ push :
17+ runs-on : ubuntu-latest
18+ permissions :
19+ packages : write
20+ contents : read
21+ strategy :
22+ matrix :
23+ image :
24+ - wis2box-ui
25+
26+ steps :
27+ - name : Checkout branch
28+ uses : actions/checkout@v4
29+
30+ - name : Set up QEMU
31+ uses : docker/setup-qemu-action@v1
32+
33+ - name : Login to GitHub Container Registry
34+ uses : docker/login-action@v2
35+ with :
36+ registry : ghcr.io
37+ username : ${{ github.repository_owner }}
38+ password : ${{ secrets.GITHUB_TOKEN }}
39+
40+ - name : Set up Docker Buildx
41+ id : buildx
42+ uses : docker/setup-buildx-action@v1
43+
44+ - name : Docker meta
45+ id : meta
46+ uses : docker/metadata-action@v4
47+ with :
48+ images : |
49+ ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}
50+ tags : |
51+ type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
52+ type=raw,value=${{ github.ref_name }},enable=${{ startsWith(github.ref, 'refs/tags/') }}
53+
54+ - name : Build and push
55+ uses : docker/build-push-action@v2.7.0
56+ with :
57+ context : ./
58+ file : ./Dockerfile
59+ cache-from : type=gha
60+ cache-to : type=gha,mode=max
61+ platforms : linux/arm64, linux/amd64
62+ push : true
63+ tags : ${{ steps.meta.outputs.tags }}
64+ labels : ${{ steps.meta.outputs.labels }}
0 commit comments