diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 0b8ff19..894ea29 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,13 +1,14 @@ name: CD on: - push: - branches: - - "main" + workflow_run: + workflows: [CI] + types: [completed] + branches: [main] jobs: deploy: runs-on: ubuntu-latest - + if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@8230315d06ad95c617244d2f265d237a1682d445 - name: Tag and Push Gem @@ -19,8 +20,7 @@ jobs: GIT_NAME: ${{secrets.ALEX_GIT_NAME}} RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}} - name: Create GitHub Release - uses: softprops/action-gh-release@cd28b0f5ee8571b76cfdaa62a30d51d752317477 + run: gh release create v${{steps.tag-and-push-gem.outputs.gem_version}} --generate-notes if: ${{ steps.tag-and-push-gem.outputs.new_version == 'true' }} - with: - tag_name: v${{steps.tag-and-push-gem.outputs.gem_version}} - generate_release_notes: true + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}