Build and Deploy #145
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy | |
on: | |
push: | |
branches: ctb/dev-update | |
schedule: | |
- cron: "15 21 * * Mon,Fri" | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
env: | |
CNAME_tw: term.clam.tw | |
CNAME_moe: term.clam.moe | |
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 | |
run: | | |
yarn | |
yarn build | |
echo "${CNAME_tw}" | tee dist/CNAME | |
env: | |
PTTCHROME_THEME: 'clamtestbbs' | |
PTTCHROME_PAGE_TITLE: "殼層體驗 Clam-Test BBS" | |
DEFAULT_SITE: 'wsstelnet://ws.clam.tw/bbs' | |
ALLOW_SITE_IN_QUERY: "no" | |
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
DEV_PROXY_TARGET: 'https://ws.clam.tw' | |
DEV_PROXY_HEADER: 'https://term.clam.tw' | |
NODE_OPTIONS: '--openssl-legacy-provider' | |
- name: Deploy 🚀 | |
uses: JamesIves/[email protected] | |
with: | |
GITHUB_TOKEN: ${{ secrets.DEPLOY_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: Install and Build | |
run: | | |
yarn | |
yarn build | |
echo "${CNAME_moe}" | tee dist/CNAME | |
env: | |
PTTCHROME_THEME: 'clamtestbbs' | |
PTTCHROME_PAGE_TITLE: "Clam-Test BBS 殼層體驗" | |
DEFAULT_SITE: 'wsstelnet://ws.clam.moe/bbs' | |
ALLOW_SITE_IN_QUERY: "no" | |
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
DEV_PROXY_TARGET: 'https://ws.clam.moe' | |
DEV_PROXY_HEADER: 'https://term.clam.moe' | |
NODE_OPTIONS: '--openssl-legacy-provider' | |
- name: Pushes to another repository | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.DEPLOY_TOKEN }} | |
with: | |
source-directory: 'dist' | |
destination-github-username: 'clamtestbbs' | |
destination-repository-name: ${{ env.CNAME_moe }} | |
user-email: [email protected] | |
target-branch: master |