Skip to content

Update main.yml

Update main.yml #24

Workflow file for this run

name: Build and Deploy
on:
push:
branches:
- master # Adjust the branch name as needed
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set Up Node.js
uses: actions/setup-node@v4
with:
node-version: 16
- name: Install Dependencies
run: npm install
working-directory: web
- name: Build Project
run: npm run build
working-directory: web
- name: Archive artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: web/dist
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: dist
path: web/dist
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: web/dist
keep_files: .