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

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