build_container.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: Build Docker Container
  2. on:
  3. push:
  4. release:
  5. types: [published]
  6. workflow_dispatch: ~
  7. jobs:
  8. publish:
  9. runs-on: ubuntu-latest
  10. permissions:
  11. contents: read
  12. packages: write
  13. steps:
  14. - name: Checkout Project
  15. uses: actions/checkout@v4
  16. - name: Generate Docker Meta
  17. uses: docker/metadata-action@v5
  18. id: meta
  19. with:
  20. images: ghcr.io/${{ github.repository }}
  21. tags: |
  22. type=ref,event=branch
  23. type=semver,pattern={{version}}
  24. type=semver,pattern={{major}}.{{minor}}
  25. type=semver,pattern={{major}}
  26. type=sha
  27. - name: Set up QEMU
  28. uses: docker/setup-qemu-action@v3
  29. - name: Setup Docker Buildx
  30. uses: docker/setup-buildx-action@v3.1.0
  31. - name: Login to GitHub Container Registry
  32. uses: docker/login-action@v3.0.0
  33. with:
  34. registry: ghcr.io
  35. username: ${{ github.repository_owner }}
  36. password: ${{ secrets.GITHUB_TOKEN }}
  37. - name: Build and Push Docker image
  38. uses: docker/build-push-action@v5.2.0
  39. with:
  40. context: .
  41. push: true
  42. platforms: linux/amd64
  43. tags: ${{ steps.meta.outputs.tags }}
  44. labels: ${{ steps.meta.outputs.labels }}