-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): move docs deploy to separate flow (#6762)
* chore(ci): move docs deploy to separate flow this allows PR branches to also get docs previews * Update .github/workflows/deploy-docs.yml Co-authored-by: Giorgio Boa <[email protected]> --------- Co-authored-by: Giorgio Boa <[email protected]>
- Loading branch information
Showing
2 changed files
with
58 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# a workflow that runs after the "Qwik CI" workflow is successful | ||
# and deploys the documentation to CloudFlare Pages. | ||
|
||
name: Deploy Docs | ||
|
||
on: | ||
workflow_run: | ||
workflows: ['Qwik CI'] | ||
types: | ||
- completed | ||
|
||
permissions: | ||
actions: read | ||
deployments: write | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
deploy: | ||
name: Cloudflare Pages Deployment | ||
if: > | ||
github.repository == 'QwikDev/qwik' && | ||
github.event.workflow_run.event == 'pull_request' && | ||
github.event.workflow_run.conclusion == 'success' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download docs artifact | ||
continue-on-error: true | ||
uses: actions/download-artifact@v4 | ||
id: download-artifact | ||
with: | ||
name: artifact-docs | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
run-id: ${{ github.event.workflow_run.id }} | ||
path: | | ||
packages/docs/dist | ||
packages/docs/server | ||
# not the official version, so be careful when updating | ||
- name: Deploy to Cloudflare Pages | ||
# if the docs didn't build, don't deploy but don't fail the workflow | ||
if: success() | ||
uses: AdrianGonz97/refined-cf-pages-action@11cfce77186cf1bd43f2fe42a84ea1996bcfe3c9 | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
projectName: 'qwik-docs' | ||
directory: packages/docs/dist | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} |