release-rc.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. run: |
  13. semver=`npm run version --silent`
  14. echo "::set-output name=SEMVER::$semver"
  15. - name: Docker meta
  16. id: meta
  17. uses: docker/metadata-action@v3
  18. with:
  19. images: weseek/growi,ghcr.io/weseek/growi
  20. tags: |
  21. type=raw,value=${{ steps.meta.semver.outputs.SEMVER }}
  22. type=raw,value=${{ steps.meta.semver.outputs.SEMVER }}.{{sha}}
  23. - name: Login to docker.io registry
  24. run: |
  25. echo ${{ secrets. DOCKER_REGISTRY_PASSWORD }} | docker login --username wsmoogle --password-stdin
  26. - name: Login to GitHub Container Registry
  27. uses: docker/login-action@v1
  28. with:
  29. registry: ghcr.io
  30. username: wsmoogle
  31. password: ${{ secrets.DOCKER_REGISTRY_ON_GITHUB_PASSWORD }}
  32. - name: Set up Docker Buildx
  33. uses: docker/setup-buildx-action@v1
  34. - name: Build and push
  35. uses: docker/build-push-action@v2
  36. with:
  37. context: .
  38. file: ./docker/Dockerfile
  39. platforms: linux/amd64
  40. push: true
  41. tags: ${{ steps.meta.outputs.tags }}
  42. - name: Check whether workspace is clean
  43. run: |
  44. STATUS=`git status --porcelain`
  45. if [ -z "$STATUS" ]; then exit 0; else exit 1; fi