docker_build_pre.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. name: Docker Image CI Pre
  2. on:
  3. workflow_dispatch:
  4. release:
  5. types: [ prereleased ]
  6. env:
  7. REGISTRY: ghcr.io
  8. jobs:
  9. build-and-push-image:
  10. runs-on: ubuntu-latest
  11. permissions:
  12. contents: read
  13. packages: write
  14. steps:
  15. - name: Get version
  16. id: get_version
  17. run: |
  18. echo "VERSION=pre${GITHUB_REF/refs\/tags\//}" >> ${GITHUB_ENV}
  19. echo "${GITHUB_REF/refs\/tags\//}"
  20. echo "${GITHUB_REF#refs/*/}"
  21. echo "${GITHUB_REF}"
  22. - uses: actions/checkout@v3
  23. - name: set lower case repository name
  24. run: |
  25. echo "REPOSITORY_LC=${REPOSITORY,,}" >> ${GITHUB_ENV}
  26. env:
  27. REPOSITORY: '${{ github.repository }}'
  28. - name: Set up QEMU
  29. uses: docker/setup-qemu-action@v3
  30. - name: Set up Docker Buildx
  31. uses: docker/setup-buildx-action@v3
  32. - uses: actions/setup-node@v4
  33. - name: Build FE
  34. run: make build_fe
  35. - name: Log in to the Container registry
  36. uses: docker/login-action@v2.1.0
  37. with:
  38. registry: ${{ env.REGISTRY }}
  39. username: ${{ github.actor }}
  40. password: ${{ secrets.GITHUB_TOKEN }}
  41. - name: Build and push Docker images
  42. uses: docker/build-push-action@v4
  43. with:
  44. context: .
  45. file: ./DockerfileGithubAction
  46. platforms: |
  47. linux/386
  48. linux/amd64
  49. linux/arm/v7
  50. linux/arm64
  51. linux/mips64le
  52. linux/ppc64le
  53. push: true
  54. tags: |
  55. ${{ env.REGISTRY }}/${{ env.REPOSITORY_LC }}:${{ env.VERSION }}