Skip to content

Jiahan CS 6120 Final Project Blog #702

Jiahan CS 6120 Final Project Blog

Jiahan CS 6120 Final Project Blog #702

Workflow file for this run

on:
push:
branches:
- 2023fa
pull_request:
branches:
- 2023fa
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 'Install Zola'
run: sudo snap install --edge zola
- name: 'Build Zola site'
run: zola build --drafts
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: site
path: public
deploy:
needs: build
runs-on: ubuntu-latest
if: ${{github.event_name=='push' && github.ref=='refs/heads/2023fa'}}
steps:
- name: Setup Tailscale
uses: tailscale/github-action@main
with:
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: site
path: public
- run: ls -R
- name: rsync
env:
DEPLOY_HOST: cslinux.cs.cornell.edu
DEPLOY_USER: als485
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
DEPLOY_KNOWN_HOSTS: ${{ secrets.DEPLOY_KNOWN_HOSTS }}
DEPLOY_SRC: ./public/
DEPLOY_DEST: /courses/cs6120/2023fa/site
run: |
echo "$DEPLOY_KEY" > pk
echo "$DEPLOY_KNOWN_HOSTS" > kh
chmod 600 pk
rsync --compress --recursive --checksum --itemize-changes --delete \
--perms --chmod=Du=rwx,Dgo=rx,Fu=rw,Fog=r \
-e "ssh -i pk -o 'UserKnownHostsFile kh'" \
$DEPLOY_SRC $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_DEST