fresh-vitepress-site #89
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: Factory (manual) | |
run-name: ${{ inputs.generator }}${{ inputs.dry-run && ' (dry-run)' || '' }} | |
on: | |
workflow_dispatch: | |
inputs: | |
generator: | |
description: 'The generator to run' | |
required: true | |
dry-run: | |
description: 'Dry run' | |
type: boolean | |
default: false | |
required: false | |
jobs: | |
build: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
env: | |
BUILD_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: docker/setup-buildx-action@v1 | |
- uses: docker/build-push-action@v2 | |
with: | |
context: runner | |
load: true | |
tags: factory-runner | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- uses: docker/build-push-action@v2 | |
with: | |
context: screenshotter | |
load: true | |
tags: factory-screenshotter | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Obtain a GitHub App Installation Access Token | |
id: githubAppAuth | |
run: | | |
TOKEN="$(npx obtain-github-app-installation-access-token ci ${{ secrets.GH_APP_CREDENTIALS_TOKEN }})" | |
echo "::add-mask::$TOKEN" | |
echo "::set-output name=token::$TOKEN" | |
- uses: pnpm/action-setup@v2 | |
- uses: actions/setup-node@v4 | |
with: | |
cache: 'pnpm' | |
node-version: '20' | |
- run: pnpm install | |
- run: bin/run ${{ github.event.inputs.generator }} | |
- run: node provision ${{ github.event.inputs.generator }} | |
if: '!inputs.dry-run' | |
env: | |
GH_PUSH_TOKEN: ${{ steps.githubAppAuth.outputs.token }} | |
- run: bash sync.sh | |
if: '!inputs.dry-run' | |
env: | |
GH_PUSH_TOKEN: ${{ steps.githubAppAuth.outputs.token }} | |
- run: pnpm factory upload-result | |
if: '!inputs.dry-run' | |
env: | |
GH_PUSH_TOKEN: ${{ steps.githubAppAuth.outputs.token }} |