Skip to content

Commit

Permalink
ci: deploy only on successful workflow run
Browse files Browse the repository at this point in the history
  • Loading branch information
ferferga committed Nov 14, 2022
1 parent 310e687 commit 98600bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
uses: actions/upload-artifact@v3.1.1
if: matrix.platform == 'linux/amd64'
with:
name: client
name: frontend
path: |
dist
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,28 @@ jobs:
cf-pages:
name: CloudFlare Pages 📃
runs-on: ubuntu-latest
if: ${{ (inputs.workflow_run_id && inputs.branch) || github.event.workflow_run.conclusion == 'success' }}

steps:
- name: Download workflow artifact ⬇️
uses: dawidd6/action-download-artifact@v2.24.2
with:
run_id: ${{ inputs.workflow_run_id || github.event.workflow_run.id }}
name: frontend
path: dist

- name: Publish to Cloudflare Pages 📃
uses: cloudflare/pages-action@v1.1.0
id: cf
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: jf-vue
directory: dist
branch: ${{ inputs.branch || github.event.workflow_run.head_branch }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

- name: Create job summary 📖
run: |
echo '# CloudFlare Pages deployment' >> $GITHUB_STEP_SUMMARY
echo '${{ steps.cf.outputs.url }}' >> $GITHUB_STEP_SUMMARY
2 changes: 1 addition & 1 deletion .github/workflows/unstable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Upload artifact (Client) ⬆️💻
uses: actions/upload-artifact@v3.1.1
with:
name: client
name: frontend
path: |
dist
Expand Down

0 comments on commit 98600bf

Please sign in to comment.