docker-publish-arm.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. name: Publish Docker Image ARM64
  2. on:
  3. release:
  4. types: [published]
  5. workflow_dispatch:
  6. inputs:
  7. tag:
  8. description: 'Tag to build and publish'
  9. required: true
  10. default: 'latest'
  11. env:
  12. REGISTRY: docker.io
  13. IMAGE_NAME: cashubtc/mintd
  14. jobs:
  15. build-and-push:
  16. runs-on: ubuntu-latest
  17. permissions:
  18. contents: read
  19. packages: write
  20. steps:
  21. - name: Checkout repository
  22. uses: actions/checkout@v4
  23. - name: Set up Docker Buildx
  24. uses: docker/setup-buildx-action@v3
  25. - name: Login to Docker Hub
  26. uses: docker/login-action@v3
  27. with:
  28. username: ${{ secrets.DOCKERHUB_USERNAME }}
  29. password: ${{ secrets.DOCKERHUB_TOKEN }}
  30. - name: Extract metadata (tags, labels) for Docker
  31. id: meta
  32. uses: docker/metadata-action@v5
  33. with:
  34. images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
  35. tags: |
  36. type=raw,value=latest-arm64,enable=${{ github.event_name == 'release' }}
  37. type=semver,pattern={{version}}-arm64
  38. type=semver,pattern={{major}}.{{minor}}-arm64
  39. type=ref,event=branch,suffix=-arm64
  40. type=ref,event=pr,suffix=-arm64
  41. type=sha,suffix=-arm64
  42. ${{ github.event.inputs.tag != '' && format('{0}-arm64', github.event.inputs.tag) || '' }}
  43. # Build and push ARM64 image with architecture suffix
  44. - name: Build and push Docker image
  45. uses: docker/build-push-action@v5
  46. with:
  47. context: .
  48. push: true
  49. platforms: linux/arm64
  50. file: ./Dockerfile.arm
  51. tags: ${{ steps.meta.outputs.tags }}-arm64
  52. labels: ${{ steps.meta.outputs.labels }}
  53. cache-from: type=gha
  54. cache-to: type=gha,mode=max