|
| 1 | +name: Automated Deployment |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + |
| 8 | +jobs: |
| 9 | + about: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Checkout |
| 13 | + uses: actions/checkout@v2 |
| 14 | + |
| 15 | + - name: Jaid/action-sync-node-meta |
| 16 | + uses: jaid/action-sync-node-meta@v1.4.0 |
| 17 | + with: |
| 18 | + direction: overwrite-github # default is overwrite-file |
| 19 | + githubToken: ${{ secrets.GITHUB }} |
| 20 | + |
| 21 | + # docs: |
| 22 | + # runs-on: ubuntu-latest |
| 23 | + # steps: |
| 24 | + # - name: Checkout |
| 25 | + # uses: actions/checkout@v2 |
| 26 | + |
| 27 | + # - name: update documentation |
| 28 | + # uses: CoCreate-app/CoCreate-docs@master |
| 29 | + |
| 30 | + release: |
| 31 | + runs-on: ubuntu-latest |
| 32 | + steps: |
| 33 | + - name: Checkout |
| 34 | + uses: actions/checkout@v2 |
| 35 | + |
| 36 | + - name: Semantic Release |
| 37 | + uses: cycjimmy/semantic-release-action@v2 |
| 38 | + id: semantic |
| 39 | + with: |
| 40 | + # You can specify specifying version range for the extra plugins if you prefer. |
| 41 | + extra_plugins: | |
| 42 | + @semantic-release/changelog |
| 43 | + @semantic-release/npm |
| 44 | + @semantic-release/git |
| 45 | + @semantic-release/github |
| 46 | + env: |
| 47 | + GITHUB_TOKEN: ${{ secrets.GITHUB }} |
| 48 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Auto Changog generator |
| 49 | + outputs: |
| 50 | + new_release_published: ${{ steps.semantic.outputs.new_release_published }} |
| 51 | + new_release_version: ${{ steps.semantic.outputs.new_release_version }} |
| 52 | + |
| 53 | + package: |
| 54 | + runs-on: ubuntu-latest |
| 55 | + needs: release |
| 56 | + if: needs.release.outputs.new_release_published == 'true' |
| 57 | + env: |
| 58 | + IMAGE: docker.pkg.github.com/cocreate-app/cocreate-docs |
| 59 | + VERSION: ${{ needs.release.outputs.new_release_version }} |
| 60 | + steps: |
| 61 | + - name: Checkout repository |
| 62 | + uses: actions/checkout@v1 |
| 63 | + |
| 64 | + - name: npm login |
| 65 | + env: |
| 66 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 67 | + run: > |
| 68 | + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > |
| 69 | + .npmrc |
| 70 | + - name: Login docker registry |
| 71 | + env: |
| 72 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 73 | + run: | |
| 74 | + docker login docker.pkg.github.com -u ${GITHUB_ACTOR} -p ${GITHUB_TOKEN} |
| 75 | +
|
| 76 | + - name: Build docker image |
| 77 | + run: docker build . -t ${IMAGE}:latest -t ${IMAGE}:${VERSION} |
| 78 | + |
| 79 | + - name: Push docker image |
| 80 | + run: | |
| 81 | + docker push ${IMAGE}:latest |
| 82 | + docker push ${IMAGE}:${VERSION} |
0 commit comments