build-and-push-test-image.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. name: build-and-push-test-image
  2. on:
  3. push:
  4. branches: [main]
  5. jobs:
  6. build-and-push-test-image:
  7. runs-on: ubuntu-latest
  8. permissions:
  9. contents: read
  10. packages: write
  11. steps:
  12. - uses: actions/checkout@v4
  13. - name: Set up QEMU
  14. uses: docker/setup-qemu-action@v3
  15. - name: Login to Docker Hub
  16. uses: docker/login-action@v3
  17. with:
  18. username: stevenlgtm
  19. password: ${{ secrets.DOCKER_HUB_TOKEN }}
  20. - name: Login to GitHub Container Registry
  21. uses: docker/login-action@v3
  22. with:
  23. registry: ghcr.io
  24. username: ${{ github.actor }}
  25. password: ${{ github.token }}
  26. - name: Set up Docker Buildx
  27. id: buildx
  28. uses: docker/setup-buildx-action@v3
  29. with:
  30. install: true
  31. version: v0.9.1
  32. - name: Docker meta
  33. id: meta
  34. uses: docker/metadata-action@v5
  35. with:
  36. images: |
  37. neosmemo/memos
  38. ghcr.io/usememos/memos
  39. flavor: |
  40. latest=false
  41. tags: |
  42. type=raw,value=test
  43. - name: Build and Push
  44. id: docker_build
  45. uses: docker/build-push-action@v6
  46. with:
  47. context: ./
  48. file: ./Dockerfile
  49. platforms: linux/amd64
  50. push: true
  51. tags: ${{ steps.meta.outputs.tags }}
  52. labels: ${{ steps.meta.outputs.labels }}