Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
ci: make documentation deploy it's own separate job
Browse files Browse the repository at this point in the history
  • Loading branch information
thislooksfun committed Mar 12, 2021
1 parent 866a600 commit efa4944
Showing 1 changed file with 18 additions and 24 deletions.
42 changes: 18 additions & 24 deletions .github/workflows/test-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,6 @@ jobs:
- run: npm run build
- run: npm test

# This is a TEMPORARY job to deploy docs while in alpha.
# TODO: Remove this when releasing v1.0.0
alphadoc:
name: Alpha Documentation
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: [test]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- run: npm ci
- run: npm run gendoc && touch docs/.nojekyll
- run: npx husky uninstall
- name: Deploy docs
uses: JamesIves/github-pages-deploy-action@4.0.0
with:
branch: gh-pages
folder: docs
clean: true

release:
name: Release
runs-on: ubuntu-latest
Expand All @@ -57,15 +35,31 @@ jobs:
node-version: 14.x
- run: npm ci
- run: npm run build
- run: npm run gendoc && touch docs/.nojekyll
- id: semrel
uses: codfish/semantic-release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

deploydoc:
name: Deploy documentation
runs-on: ubuntu-latest
# TODO: This TEMPORARILY bypasses the release job.
# BODY: This should be made to require the release job before v1.0.0. At
# BODY: that point we can likely also remove the 'if' clause here since that
# BODY: is accounted for by requiring 'release'.
# needs: [release]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: [test]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- run: npm ci
- run: npm run gendoc && touch docs/.nojekyll
- run: npx husky uninstall
- name: Deploy docs
if: steps.semrel.outputs.new-release-published == 'true'
uses: JamesIves/github-pages-deploy-action@4.0.0
with:
branch: gh-pages
Expand Down

0 comments on commit efa4944

Please sign in to comment.