release-rc.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. name: Release Docker Images for RC
  2. on:
  3. push:
  4. branches:
  5. - rc/**
  6. jobs:
  7. build-rc:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - uses: actions/checkout@v2
  11. - name: Retrieve information from package.json
  12. uses: myrotvorets/info-from-package-json-action@0.0.2
  13. id: package-json
  14. - name: Docker meta
  15. id: meta
  16. uses: docker/metadata-action@v3
  17. with:
  18. images: weseek/growi,ghcr.io/weseek/growi
  19. tags: |
  20. type=raw,value=${{ steps.package-json.outputs.packageVersion }}
  21. type=raw,value=${{ steps.package-json.outputs.packageVersion }}.{{sha}}
  22. - name: Login to docker.io registry
  23. run: |
  24. echo ${{ secrets. DOCKER_REGISTRY_PASSWORD }} | docker login --username wsmoogle --password-stdin
  25. - name: Login to GitHub Container Registry
  26. uses: docker/login-action@v1
  27. with:
  28. registry: ghcr.io
  29. username: wsmoogle
  30. password: ${{ secrets.DOCKER_REGISTRY_ON_GITHUB_PASSWORD }}
  31. - name: Set up Docker Buildx
  32. uses: docker/setup-buildx-action@v1
  33. - name: Cache Docker layers
  34. uses: actions/cache@v2
  35. with:
  36. path: /tmp/.buildx-cache
  37. key: ${{ runner.os }}-buildx-app-${{ github.sha }}
  38. restore-keys: |
  39. ${{ runner.os }}-buildx-app-
  40. - name: Build and push
  41. uses: docker/build-push-action@v2
  42. with:
  43. context: .
  44. file: ./packages/app/docker/Dockerfile
  45. platforms: linux/amd64
  46. push: true
  47. cache-from: type=local,src=/tmp/.buildx-cache
  48. cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
  49. tags: ${{ steps.meta.outputs.tags }}
  50. - name: Move cache
  51. run: |
  52. rm -rf /tmp/.buildx-cache
  53. mv /tmp/.buildx-cache-new /tmp/.buildx-cache