FossilRepo
Add Docker Hub publish workflow (multi-arch, auto-tag)
Commit
c76d79886213b96e37c0bc3f6dd5c6210f0df90db7d99af9784a2dd62675125a
Parent
747858abc22a4fb…
1 file changed
+48
| --- a/.github/workflows/docker.yaml | ||
| +++ b/.github/workflows/docker.yaml | ||
| @@ -0,0 +1,48 @@ | ||
| 1 | +name: Docker | |
| 2 | + | |
| 3 | +on: | |
| 4 | + push: | |
| 5 | + branches: [main] | |
| 6 | + tags: ["v*"] | |
| 7 | + | |
| 8 | +jobs: | |
| 9 | + ci: | |
| 10 | + uses: ./.github/workflows/ci.yaml | |
| 11 | + | |
| 12 | + publish: | |
| 13 | + needs: [ci] | |
| 14 | + runs-on: ubuntu-latest | |
| 15 | + permissions: | |
| 16 | + contents: read | |
| 17 | + | |
| 18 | + steps: | |
| 19 | + - uses: actions/checkout@v4 | |
| 20 | + | |
| 21 | + - uses: docker/setup-qemu-action@v3 | |
| 22 | + | |
| 23 | + - uses: docker/setup-buildx-action@v3 | |
| 24 | + | |
| 25 | + - uses: docker/login-action@v3 | |
| 26 | + with: | |
| 27 | + username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| 28 | + password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| 29 | + | |
| 30 | + - uses: docker/metadata-action@v5 | |
| 31 | + id: meta | |
| 32 | + with: | |
| 33 | + images: conflicthq/fossilrepo | |
| 34 | + tags: | | |
| 35 | + type=raw,value=latest,enable={{is_default_branch}} | |
| 36 | + type=sha,prefix= | |
| 37 | + type=semver,pattern={{version}} | |
| 38 | + type=semver,pattern={{major}}.{{minor}} | |
| 39 | + | |
| 40 | + - uses: docker/build-push-action@v6 | |
| 41 | + with: | |
| 42 | + context: . | |
| 43 | + push: true | |
| 44 | + platforms: linux/amd64,linux/arm64 | |
| 45 | + tags: ${{ steps.meta.outputs.tags }} | |
| 46 | + labels: ${{ steps.meta.outputs.labels }} | |
| 47 | + cache-from: type=gha | |
| 48 | + cache-to: type=gha,mode=max |
| --- a/.github/workflows/docker.yaml | |
| +++ b/.github/workflows/docker.yaml | |
| @@ -0,0 +1,48 @@ | |
| --- a/.github/workflows/docker.yaml | |
| +++ b/.github/workflows/docker.yaml | |
| @@ -0,0 +1,48 @@ | |
| 1 | name: Docker |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: [main] |
| 6 | tags: ["v*"] |
| 7 | |
| 8 | jobs: |
| 9 | ci: |
| 10 | uses: ./.github/workflows/ci.yaml |
| 11 | |
| 12 | publish: |
| 13 | needs: [ci] |
| 14 | runs-on: ubuntu-latest |
| 15 | permissions: |
| 16 | contents: read |
| 17 | |
| 18 | steps: |
| 19 | - uses: actions/checkout@v4 |
| 20 | |
| 21 | - uses: docker/setup-qemu-action@v3 |
| 22 | |
| 23 | - uses: docker/setup-buildx-action@v3 |
| 24 | |
| 25 | - uses: docker/login-action@v3 |
| 26 | with: |
| 27 | username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 28 | password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 29 | |
| 30 | - uses: docker/metadata-action@v5 |
| 31 | id: meta |
| 32 | with: |
| 33 | images: conflicthq/fossilrepo |
| 34 | tags: | |
| 35 | type=raw,value=latest,enable={{is_default_branch}} |
| 36 | type=sha,prefix= |
| 37 | type=semver,pattern={{version}} |
| 38 | type=semver,pattern={{major}}.{{minor}} |
| 39 | |
| 40 | - uses: docker/build-push-action@v6 |
| 41 | with: |
| 42 | context: . |
| 43 | push: true |
| 44 | platforms: linux/amd64,linux/arm64 |
| 45 | tags: ${{ steps.meta.outputs.tags }} |
| 46 | labels: ${{ steps.meta.outputs.labels }} |
| 47 | cache-from: type=gha |
| 48 | cache-to: type=gha,mode=max |