Skip to content

Commit

Permalink
ci(docs): add preview/production docs envs
Browse files Browse the repository at this point in the history
  • Loading branch information
mattallty committed Aug 28, 2023
1 parent 2760141 commit ae6fcce
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,24 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

# we run docs:build twice because of the way the sidebar in vuepress plugin is generated
- name: Deploy website
- name: Deploy preview website
if: ${{ github.ref_name != 'master' }}
run: |
pnpm build:typedocs
pnpm docs:build
pnpm docs:build
pnpm exec wrangler pages deploy docs/.vuepress/dist --branch ${{ github.ref_name }} --project-name caporal-website
pnpm exec wrangler pages deploy docs/.vuepress/dist --environment preview --project-name caporal-website
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

- name: Deploy production website
if: ${{ github.ref_name == 'master' }}
run: |
pnpm build:typedocs
pnpm docs:build
pnpm docs:build
pnpm exec wrangler pages deploy docs/.vuepress/dist --environment production --project-name caporal-website
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

0 comments on commit ae6fcce

Please sign in to comment.