Build workspace packages #56
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 workspace packages | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- /*.md | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- /*.md | |
schedule: | |
- cron: 7 0 * * MON | |
jobs: | |
build_linux: | |
name: Build workspace packages (Linux) | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
cache: yarn | |
cache-dependency-path: | | |
yarn.lock | |
- name: Restore workspace | |
shell: pwsh | |
run: ./scripts/Restore-Workspace.ps1 | |
- name: Build workspace | |
shell: pwsh | |
run: ./scripts/Build-Workspace.ps1 | |
- name: Analyze workspace | |
shell: pwsh | |
run: ./scripts/Analyze-Workspace.ps1 | |
- name: Build GitHub Pages | |
shell: pwsh | |
run: ./scripts/Build-GitHubPages.ps1 | |
- name: Collect artifacts | |
if: always() | |
shell: pwsh | |
run: ./scripts/Collect-Artifacts.ps1 -ArtifactPath build-artifacts | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: build-artifacts | |
path: ./build-artifacts | |
deploy_gh_pages: | |
if: github.ref == 'refs/heads/main' | |
environment: | |
name: github-pages | |
url: ${{ steps.deploy-pages.outputs.page_url }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
needs: build_linux | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: build-artifacts | |
path: ./build-artifacts | |
pattern: /workspace-packages/@jscorlib-repo/gh-pages-hosting | |
- name: Upload pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./build-artifacts/workspace-packages/@jscorlib-repo/gh-pages-hosting/dist | |
- name: Deploy to GitHub Pages | |
id: deploy-pages | |
uses: actions/deploy-pages@v4 |