github pages ci/cd #3
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 Astro to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# 1. Config repository | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# 2. Config Node.js | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
cache: 'npm' | |
# 3. Install dependencies | |
- name: Install dependencies | |
run: npm install | |
# 4. Compile Astro | |
- name: Build Astro | |
run: npm run build | |
# 5. Deploy | |
- name: Deploy to GitHub Pages | |
uses: actions/deploy-pages@v1 |