Merge pull request #894 from live-codes/develop #65
This file contains hidden or 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: 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 <support+actions@github.com>" | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} |