Skip to content

Build and Deploy

Build and Deploy #404

Workflow file for this run

name: Build and Deploy
on:
push:
branches: SERvGear-X
schedule:
- cron: "15 21 * * Wed,Sun"
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@master # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version: 19
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
yarn
yarn build
echo "$CNAME" > dist/CNAME
env:
CNAME: 'term.ccns.cc'
PTTCHROME_THEME: 'ccns'
PTTCHROME_PAGE_TITLE: 'SERvGear-X'
DEFAULT_SITE: 'wsstelnet://ws.ccns.cc/bbs'
ALLOW_SITE_IN_QUERY: "yes"
DEV_PROXY_TARGET: 'https://ws.ccns.cc'
DEV_PROXY_HEADER: 'https://term.ccns.cc'
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
GITHUB_REPOSITORY: ${{ github.repository }}
NODE_OPTIONS: '--openssl-legacy-provider'
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: dist # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch
- name: Rebuild for term.ccns.ncku.edu.tw
run: |
rm -vrf dist
yarn
yarn build
echo "$CNAME" > dist/CNAME
env:
CNAME: 'term.ccns.ncku.edu.tw'
PTTCHROME_THEME: 'ccns'
PTTCHROME_PAGE_TITLE: 'SERvGear-X'
DEFAULT_SITE: 'wsstelnet://ws.ccns.ncku.edu.tw/bbs'
ALLOW_SITE_IN_QUERY: "yes"
DEV_PROXY_TARGET: 'https://ws.ccns.ncku.edu.tw'
DEV_PROXY_HEADER: 'https://term.ccns.ncku.edu.tw'
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
GITHUB_REPOSITORY: 'term.ccns.ncku.edu.tw'
NODE_OPTIONS: '--openssl-legacy-provider'
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.PTTCHROME_TOKEN }}
repository-name: '${{ github.repository_owner }}/term.ccns.ncku.edu.tw'
branch: main # The branch the action should deploy to.
folder: dist # The folder the action should deploy.
clean: true # Automatically remove deleted files from the deploy branch