Deploy #350
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: Deploy | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 3 * * *' # Every day at 3am | |
jobs: | |
deploy: | |
runs-on: self-hosted | |
steps: | |
- name: Checkout main branch | |
uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16.x' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build gatsby pages (james.lu) | |
run: npm run build | |
env: | |
MONGODB_CONN_STRING: ${{ secrets.MONGODB_CONN_STRING }} | |
- name: Move to web directory | |
run: rm -rf ~/personal-website/public; cp -r ./public ~/personal-website | |
- name: Build gatsby pages (jame.lu) | |
run: npm run build | |
env: | |
MONGODB_CONN_STRING: ${{ secrets.MONGODB_CONN_STRING }} | |
GATSBY_SINGULAR: 1 | |
- name: Move to web directory | |
run: rm -rf ~/personal-website-s/public; cp -r ./public ~/personal-website-s |