-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a17749
commit 714c3b0
Showing
1 changed file
with
27 additions
and
37 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,43 @@ | ||
name: Deploy to GitHub Pages | ||
|
||
on: | ||
# Trigger the workflow every time you push to the `main` branch | ||
# Using a different branch name? Replace `main` with your branch’s name | ||
push: | ||
branches: [main] | ||
# Allows you to run this workflow manually from the Actions tab on GitHub. | ||
workflow_dispatch: | ||
branches: | ||
- main | ||
|
||
# Allow this job to clone the repo and create a page deployment | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout your repository using git | ||
uses: actions/checkout@v3 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 20 | ||
- name: npm ci, build | ||
run: | | ||
npm ci | ||
npm run build | ||
- name: Upload Pages Artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
name: page | ||
path: "dist/" | ||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
environment: | ||
name: github-pages | ||
url: ${{steps.deployment.outputs.page_url}} | ||
|
||
url: ${{ steps.deploy.outputs.page_url }} | ||
steps: | ||
- uses: actions/download-artifact@master | ||
# Checkout project repository | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
# Setup Node.js environment | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
name: page | ||
path: . | ||
- uses: actions/configure-pages@v1 | ||
- uses: actions/upload-pages-artifact@v3 | ||
node-version: "18.x" | ||
|
||
# Install dependencies | ||
- name: Install dependencies | ||
run: npm install --prefer-offline | ||
|
||
# Build Application | ||
- name: Build application | ||
run: npm build | ||
|
||
# Deploy to Github Pages | ||
- id: deploy | ||
name: Deploy to Github Pages | ||
uses: fcodelabs/[email protected] | ||
with: | ||
path: . | ||
- id: deployment | ||
uses: actions/deploy-pages@main | ||
build_dir: dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |