Skip to content

Commit

Permalink
Update build-and-deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
andyyu824 authored Dec 24, 2024
1 parent 496a391 commit cb630fd
Showing 1 changed file with 21 additions and 28 deletions.
49 changes: 21 additions & 28 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,40 @@ name: build_and_deploy
on:
push:
branches:
- 'main'
- "main"
paths-ignore:
- '**/README.md'
- "**/README.md"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v3

- name: clean workspace
run: rm -rf node_modules && npm cache clean --force

- name: install dependencies
run: npm ci

- name: build the project
run: npm run docker

- name: verify build output
run: ls -l build

- name: upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build
path: build

- uses: actions/checkout@v4
- name: Use Node.js 22.9.0
uses: actions/setup-node@v4
with:
node-version: 22.9.0
# - name: add config
# run: echo "${{ secrets.CONFIG_JSON }}" | base64 -d > src/config.json
- name: build
run: rm -rf node_modules && rm package-lock.json && npm cache clean --force && npm install && npm run build
- name: upload artifacts
uses: actions/upload-pages-artifact@v3
with:
path: build
deploy:
# 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
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
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit cb630fd

Please sign in to comment.