Skip to content

Build and Deploy

Build and Deploy #243

name: Build and Deployment CICD
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Nodejs
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependencies
run: |
npm i -g yarn
yarn install --frozen-lockfile
- name: Build Production
run: |
yarn check
yarn build
- name: Write Build Time
run: |
echo "{ \"build_time\": \"$(date +'%Y-%m-%d %H:%M')\" }" | jq '.' > ./build/build.json
- name: Upload Artifact
uses: actions/upload-pages-artifact@v1
with:
path: './build'
Deploy:
runs-on: ubuntu-latest
needs: Build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v2