name: Deploy # on push to main deploy (as self-hosted build) to github pages on: push: branches: - main env: NODE_VERSION: 18.x jobs: deploy: runs-on: ubuntu-latest env: NODE_OPTIONS: '--max_old_space_size=4096' steps: - name: Generate Github Token for CI Bot uses: actions/create-github-app-token@v1 id: generate-token with: app-id: ${{ secrets.CI_APP_ID }} private-key: ${{ secrets.CI_APP_PRIVATE_KEY }} - name: Checkout code uses: actions/checkout@v4 with: token: ${{ steps.generate-token.outputs.token }} - name: Use Node.js uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} cache: 'npm' cache-dependency-path: '**/package-lock.json' - name: Install dependencies run: npm ci - name: Deploy run: | git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${{github.repository}}.git npm run deploy -- -u "github-actions-bot " env: GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}