]>
Commit | Line | Data |
---|---|---|
a43fe354 BW |
1 | # Build & publish docker images |
2 | name: Dockerhub | |
3 | ||
4 | on: | |
5 | push: | |
6 | tags: [v*] | |
7 | branches: [ main ] | |
8 | ||
9 | ||
10 | jobs: | |
11 | dockerhub: | |
12 | runs-on: ubuntu-latest | |
13 | steps: | |
14 | - | |
15 | name: Checkout | |
dad372bb | 16 | uses: actions/checkout@v4 |
a43fe354 BW |
17 | - |
18 | name: Set up QEMU | |
dad372bb | 19 | uses: docker/setup-qemu-action@v3 |
a43fe354 BW |
20 | - |
21 | name: Set up Docker Buildx | |
22 | id: buildx | |
dad372bb | 23 | uses: docker/setup-buildx-action@v3 |
a43fe354 BW |
24 | - |
25 | name: Login to Docker Hub | |
26 | uses: docker/login-action@v2 | |
27 | with: | |
28 | username: ${{ secrets.DOCKERHUB_USERNAME }} | |
29 | password: ${{ secrets.DOCKERHUB_TOKEN }} | |
df903a2c GC |
30 | - |
31 | name: Login to GHCR | |
dad372bb | 32 | uses: docker/login-action@v3 |
df903a2c GC |
33 | with: |
34 | registry: ghcr.io | |
35 | username: ${{ github.actor }} | |
36 | password: ${{ github.token }} | |
a43fe354 BW |
37 | - |
38 | name: Set tag name | |
39 | run: | | |
40 | if [[ ${{ github.ref_type }} == "tag" ]]; then | |
41 | echo "IMAGE_TAG=${{ github.ref_name }}" >> $GITHUB_ENV | |
42 | else | |
43 | echo "IMAGE_TAG=latest" >> $GITHUB_ENV | |
44 | fi | |
45 | - | |
46 | name: Build and push | |
dad372bb | 47 | uses: docker/build-push-action@v5 |
a43fe354 BW |
48 | with: |
49 | push: true | |
df903a2c GC |
50 | tags: | |
51 | b4bz/homer:${{env.IMAGE_TAG}} | |
52 | ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }} | |
25000104 | 53 | platforms: linux/amd64,linux/arm/v7,linux/arm/v6,linux/arm64,linux/riscv64 |