Skip to content

Build and Deploy

Build and Deploy #14

Workflow file for this run

name: Build and Deploy
on:
workflow_dispatch:
create:
tags:
- '*.*.*'
# push:
# branches:
# - master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Cache Yarn
uses: actions/cache@v3
env:
cache-name: cache-yarn
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}
- name: Install
run: yarn install --frozen-lockfile
- name: Build
run: yarn webpack --mode production
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./dist
deploy:
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 }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2