Another attempt to solve the new artifacts actions #39
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: Build & Deploy to GitHub Pages | |
on: | |
push: | |
branches: | |
- portfolio | |
permissions: | |
pages: write # Required for GitHub Pages | |
id-token: write # Required for OIDC token usage | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22.3.0' | |
- name: Install dependencies | |
run: npm install | |
- name: Build project | |
run: npm run build # e.g. "vite build" | |
- name: List dist contents | |
run: ls -laR ./dist && du -hs ./dist | |
- name: Upload dist as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pages-artifact | |
path: ./dist | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: pages-artifact | |
path: ./dist | |
- name: Deploy to GitHub Pages | |
uses: actions/deploy-pages@v1 | |
with: | |
artifact_name: pages-artifact # MUST match what you uploaded | |
token: ${{ secrets.GITHUB_TOKEN }} |