Skip to content

website

website #161

Workflow file for this run

name: website
on:
push:
branches:
- '*-release'
jobs:
check_branch:
runs-on: ubuntu-22.04
outputs:
should_deploy: ${{ endsWith(github.ref, steps.get_version.outputs.latest) }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Get version
id: get_version
run: |
packageFile=$(if [ -d modules ]; then ls modules/core/package.json | head -n 1; else echo package.json; fi)
packageName=$(jq -r '.name' $packageFile)
LATEST=$(npm show "${packageName}@latest" version | grep -o -E "^[0-9]+\.[0-9]+")
echo "latest=${LATEST}-release" >> "$GITHUB_OUTPUT"
deploy:
runs-on: ubuntu-22.04
needs: check_branch
permissions:
contents: write
if: ${{ github.repository_owner == 'visgl' && needs.check_branch.outputs.should_deploy }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
token: ${{ secrets.WEBSITE_DEPLOY_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
- name: Enable Corepack / Yarn 4
run: |
corepack enable
corepack prepare yarn@4.13.0 --activate
yarn -v
- name: Setup Node (with Corepack)
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn' # or 'pnpm', 'npm' depending on your package manager
cache-dependency-path: yarn.lock
- name: Install dependencies and build website
run: |
yarn install --immutable
yarn website:build
- name: Deploy
uses: JamesIves/github-pages-deploy-action@132898c54c57c7cc6b80eb3a89968de8fc283505 # 3.7.1
with:
GITHUB_TOKEN: ${{ secrets.WEBSITE_DEPLOY_TOKEN }}
BRANCH: gh-pages
FOLDER: website/build
CLEAN: true