Skip to content

Gator blog post

Gator blog post #6

Workflow file for this run

on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'npm'
- run: npm ci
- run: npm run build
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: site
path: build
deploy:
needs: build
runs-on: ubuntu-latest
if: ${{github.event_name=='push' && github.ref=='refs/heads/master'}}
steps:
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: site
path: build
- name: rsync
env:
DEPLOY_HOST: courses.cit.cornell.edu
DEPLOY_USER: als485
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
DEPLOY_KNOWN_HOSTS: ${{ secrets.DEPLOY_KNOWN_HOSTS }}
DEPLOY_SRC: ./build/
DEPLOY_DEST: coursewww/capra.cs.cornell.edu/htdocs/public
run: |
echo "$DEPLOY_KEY" > pk
echo "$DEPLOY_KNOWN_HOSTS" > kh
chmod 600 pk
rsync --compress --recursive --checksum --itemize-changes --delete \
--chmod=Du=rwx,Dgo=rx,Fu=rw,Fog=r \
-e "ssh -i pk -o 'UserKnownHostsFile kh'" \
$DEPLOY_SRC $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_DEST