Creating Zowe V3 Doc branch #1158
Workflow file for this run
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: Build docs site | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
steps: | |
- name: Set Swap Space | |
uses: pierotofy/set-swap-space@master | |
with: | |
swap-size-gb: 6 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js LTS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
- name: Cache Webpack Build | |
uses: actions/cache@v3 | |
with: | |
path: node_modules/.cache/webpack | |
key: cache-webpack-${{ github.base_ref || github.ref_name }} | |
- name: Install Dependencies | |
run: npm ci | |
- name: Build with Docusaurus | |
run: npm run build | |
- name: Deploy to Netlify | |
id: deploy | |
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }} | |
uses: nwtgck/actions-netlify@v2 | |
with: | |
publish-dir: build | |
production-branch: master | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
deploy-message: "Deploy from GitHub Actions" | |
enable-pull-request-comment: true | |
enable-commit-comment: false | |
overwrites-pull-request-comment: true | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
- name: Compress Build Archive | |
if: ${{ steps.deploy.conclusion == 'skipped' }} | |
run: | | |
echo "PR_NUMBER=${{ github.event.pull_request.number }}" > build/.env | |
tar --zstd -cf build.tar.zst build | |
- name: Upload Build Artifact | |
if: ${{ steps.deploy.conclusion == 'skipped' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: preview-build | |
path: build.tar.zst | |
retention-days: 1 |