docker.yml 920 B

12345678910111213141516171819202122232425262728293031323334353637
  1. name: Docker
  2. on:
  3. workflow_dispatch:
  4. push:
  5. tags:
  6. - "v*"
  7. jobs:
  8. build:
  9. name: Build Docker image
  10. runs-on: ubuntu-latest
  11. permissions:
  12. contents: read
  13. packages: write
  14. steps:
  15. - uses: actions/checkout@v2
  16. - uses: docker/setup-qemu-action@v1
  17. - uses: docker/setup-buildx-action@v1
  18. - uses: docker/metadata-action@v3
  19. id: meta
  20. with:
  21. images: ghcr.io/${{ github.repository }}
  22. - uses: docker/login-action@v1
  23. with:
  24. registry: ghcr.io
  25. username: ${{ github.actor }}
  26. password: ${{ secrets.GITHUB_TOKEN }}
  27. - uses: docker/build-push-action@v2
  28. with:
  29. push: true
  30. context: .
  31. platforms: linux/amd64
  32. tags: ${{ steps.meta.outputs.tags }}
  33. labels: ${{ steps.meta.outputs.labels }}
  34. cache-to: type=gha,mode=max
  35. cache-from: type=gha