⬆️ Bump the github-actions group across 1 directory with 4 updates (#7) #11
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 to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main # Trigger deployment when code is pushed to 'main' | |
| - develop # Also trigger deployment when code is pushed to 'develop' | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '18' # Use Node.js version 18 or later | |
| - name: Install dependencies | |
| run: | | |
| npm install # Installs your Vite React app's dependencies | |
| - name: Build the React app | |
| run: | | |
| npm run build # Generates the 'dist' folder with production-ready files | |
| - name: Create docs directory | |
| run: | | |
| mkdir -p docs | |
| touch docs/.nojekyll | |
| cp -r dist/* docs/ | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: 'docs' | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |