Deploy to GitHub Pages #1690
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 to GitHub Pages | |
on: | |
push: | |
branches: [main] | |
schedule: | |
- cron: '34 2 * * *' # run every day at 2:34 AM | |
jobs: | |
gh-pages-deploy: | |
name: Deploy to GitHub Pages | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16.x' | |
- run: yarn install | |
env: { CI: true, TZ: America/Los_Angeles } | |
- run: yarn build | |
env: { CI: true, TZ: America/Los_Angeles } | |
- name: Set up SSH keys | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
run: | | |
mkdir -p ~/.ssh | |
touch ~/.ssh/id_ed25519 | |
chmod go-rwx ~/.ssh/id_ed25519 | |
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519 | |
ssh -o StrictHostKeyChecking=no git@github.com || true | |
- name: Upload to gh-pages | |
env: | |
CI: true | |
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=no | |
TZ: America/Los_Angeles | |
run: | |
"yarn deploy -u 'Hack Bot <uclaacmhack+ghbot@gmail.com>' \ | |
-r 'git@github.com:uclaacm/hack.uclaacm.com.git'" |