Version Packages (#1834) #208
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: Documentation Deployment | |
on: | |
push: | |
branches: | |
- 'main' | |
workflow_dispatch: | |
# Allow this job to clone the repo and create a page deployment | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
docs-changed: | |
runs-on: ubuntu-latest | |
outputs: | |
files: ${{ contains(steps.files.outputs.added_modified, 'apps/docs/') }} | |
steps: | |
- name: Get All Added and Modified Field | |
id: files | |
if: ${{ github.event_name != 'workflow_dispatch' }} | |
uses: jitterbit/get-changed-files@v1 | |
- name: Echo contains | |
if: ${{ github.event_name != 'workflow_dispatch' }} | |
run: echo ${{ contains(steps.files.outputs.added_modified, 'apps/docs/') }} | |
build-docs: | |
runs-on: ubuntu-latest | |
needs: | |
- docs-changed | |
if: ${{ needs.docs-changed.outputs.files == 'true' || github.event_name == 'workflow_dispatch' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20.x' | |
- name: Install pnpm | |
run: npm i -g pnpm | |
- name: Dependencies Install | |
run: pnpm i | |
- name: Build Docs | |
run: pnpm nx build docs | |
- name: Upload build | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
name: github-pages | |
path: dist/apps/docs/ | |
if-no-files-found: error | |
docs-deploy: | |
runs-on: ubuntu-latest | |
needs: | |
- build-docs | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: GitHub Pages Deploy Step | |
uses: actions/deploy-pages@v2 | |
id: deployment |