You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
953 B

  1. name: Build container image
  2. on:
  3. push:
  4. branches:
  5. - "main"
  6. tags:
  7. - "*"
  8. jobs:
  9. build-image:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - uses: actions/checkout@v2
  13. - uses: docker/setup-buildx-action@v1
  14. - uses: docker/login-action@v1
  15. with:
  16. registry: ghcr.io
  17. username: ${{ github.repository_owner }}
  18. password: ${{ secrets.GITHUB_TOKEN }}
  19. - uses: docker/metadata-action@v3
  20. id: meta
  21. with:
  22. images: ghcr.io/${{ github.repository_owner }}/mastodon
  23. flavor: |
  24. latest=true
  25. tags: |
  26. type=edge,branch=main
  27. type=semver,pattern={{ raw }}
  28. - uses: docker/build-push-action@v2
  29. with:
  30. context: .
  31. push: true
  32. tags: ${{ steps.meta.outputs.tags }}
  33. cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/mastodon:latest
  34. cache-to: type=inline