Skip to content

Commit

Permalink
Create deploy.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
annietsai089 authored Jul 10, 2024
0 parents commit 3208119
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: GitHub Pages Deploy
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install dependencies
working-directory: ./
run: |
npm ci
- name: Compile
working-directory: ./
run: |
npx tsc && npx vite build --base=./
- uses: actions/upload-artifact@main
with:
name: page
path: dist
if-no-files-found: error
deploy:
runs-on: ubuntu-latest
# Add a dependency to the build job
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/download-artifact@main
with:
name: page
path: .
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: .
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 3208119

Please sign in to comment.