Update deploy.yaml #2
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: Deploy to GitHub Pages | |
# This workflow is triggered on a push to the 'main' branch | |
on: | |
push: | |
branches: | |
- main | |
# Also allows for manual deployment | |
workflow_dispatch: | |
jobs: | |
build: | |
# Run the job on the latest Ubuntu environment | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository code | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# Step 2: Set up Node.js version 20.30 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20.30' | |
# Step 3: Install dependencies from package.json | |
- name: Install dependencies | |
run: npm install | |
# Step 4: Build the Astro site (output will be in the 'dist' directory) | |
- name: Build Astro site | |
run: npm run build | |
# Step 5: Deploy to GitHub Pages using the 'dist' directory | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.SURVEILR_GITHUB_TOKEN }} | |
publish_dir: ./docs |