release-rc.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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: Setup semver
  12. id: semver
  13. run: |
  14. semver=`npm run version --silent`
  15. echo "::set-output name=SEMVER::$semver"
  16. - name: Docker meta
  17. id: meta
  18. uses: docker/metadata-action@v3
  19. with:
  20. images: weseek/growi,ghcr.io/weseek/growi
  21. tags: |
  22. type=raw,value=${{ steps.semver.outputs.SEMVER }}
  23. type=raw,value=${{ steps.semver.outputs.SEMVER }}.{{sha}}
  24. - name: Login to docker.io registry
  25. run: |
  26. echo ${{ secrets. DOCKER_REGISTRY_PASSWORD }} | docker login --username wsmoogle --password-stdin
  27. - name: Login to GitHub Container Registry
  28. uses: docker/login-action@v1
  29. with:
  30. registry: ghcr.io
  31. username: wsmoogle
  32. password: ${{ secrets.DOCKER_REGISTRY_ON_GITHUB_PASSWORD }}
  33. - name: Set up Docker Buildx
  34. uses: docker/setup-buildx-action@v1
  35. - name: Cache Docker layers
  36. uses: actions/cache@v2
  37. with:
  38. path: /tmp/.buildx-cache
  39. key: ${{ runner.os }}-buildx-app-${{ github.sha }}
  40. restore-keys: |
  41. ${{ runner.os }}-buildx-app-
  42. - name: Build and push
  43. uses: docker/build-push-action@v2
  44. with:
  45. context: .
  46. file: ./docker/Dockerfile
  47. platforms: linux/amd64
  48. push: true
  49. cache-from: type=local,src=/tmp/.buildx-cache
  50. cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
  51. tags: ${{ steps.meta.outputs.tags }}
  52. - name: Move cache
  53. run: |
  54. rm -rf /tmp/.buildx-cache
  55. mv /tmp/.buildx-cache-new /tmp/.buildx-cache