refactor(gh-actions): fix docs generation flow to use bundled artifact #351
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
name: antmarky | |
on: [push] | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
node-setup: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/node-cache | |
id: cache-node-modules | |
with: | |
node-version: '16' | |
- run: npm i | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run-lint: | |
name: ✅ Linter | |
needs: node-setup | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/node-cache | |
id: cache-node-modules | |
with: | |
node-version: '16' | |
- name: ✅ Run code style linter | |
id: linter | |
run: npm run lint | |
run-tests: | |
name: 🧪 Tests | |
needs: node-setup | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/node-cache | |
id: cache-node-modules | |
with: | |
node-version: '16' | |
- name: 🧪 Run tests | |
id: tests | |
run: npm test | |
- name: 📈 Send test coverage to Coveralls | |
id: coverage | |
if: steps.tests.outcome == 'success' | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
generate-docs: | |
name: 📚 Generate documentation | |
needs: [run-tests, run-lint] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/node-cache | |
id: cache-node-modules | |
with: | |
node-version: '16' | |
- name: 📚 Generate documentation | |
id: build_docs | |
if: steps.cache-node-modules.outcome == 'success' | |
run: npm run build | |
- name: 🚀 Deploy to GitHub Pages | |
if: steps.build_docs.outcome == 'success' && github.ref == 'refs/heads/main' | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./dist | |
generate-release: | |
name: 📦 Generate GitHub Release | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: generate-docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Create a GitHub release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body: 'This release was generated automatically. Full details will be available soon' | |
draft: true |