remove already existing files before deployment #3
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: CI and Deploy to GitHub Pages | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: '22' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run Tests | |
| run: npm run ci:test-headless | |
| - name: Build the project | |
| run: npm run build --prod -- --base-href / | |
| deploy: | |
| if: github.event_name == 'push' || github.event_name == 'release' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: '22' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build the project | |
| run: npm run build --prod -- --base-href / | |
| - name: Create .nojekyll file | |
| run: echo > ./dist/s-qee-z-scripting-language.github.io/browser/.nojekyll | |
| - name: Move files to root for deployment | |
| run: | | |
| mkdir -p ./root | |
| cp -r ./dist/s-qee-z-scripting-language.github.io/browser/* ./root/ | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./root | |
| commit_message: 'Deploy to GitHub Pages' | |
| allow_empty_commit: true | |
| clean: true |