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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Get version id: get_version run: | LATEST=$(npm show react-map-gl 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: token: ${{ secrets.WEBSITE_DEPLOY_TOKEN }} - name: Setup Node.js uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 with: node-version-file: '.nvmrc' cache: 'yarn' - name: Enable Corepack run: corepack enable yarn - name: Install dependencies run: | yarn bootstrap (cd website && yarn) - name: Build website env: MapboxAccessToken: ${{ secrets.MAPBOX_ACCESS_TOKEN }} run: (cd website && yarn build) - name: Deploy uses: JamesIves/github-pages-deploy-action@132898c54c57c7cc6b80eb3a89968de8fc283505 # 3.7.1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages FOLDER: website/build CLEAN: true