Build and Publish Site #262
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 Publish Site | |
on: | |
workflow_dispatch: | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
env: | |
MY_ENV_VAR: "some_value" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.x' | |
- name: Install dependencies | |
run: npm install | |
- name: Build project | |
env: | |
AIRTABLE_TOKEN: ${{ secrets.AIRTABLE_TOKEN }} | |
AIRTABLE_PEOPLE_BASE_ID: appk2btw36qEO3vFo | |
AIRTABLE_RESEARCH_BASE_ID: appTv9J1zxqaNgBHi | |
AIRTABLE_EVENTS_BASE_ID: tbl6CURONRn8ML6le | |
AIRTABLE_POSTS_BASE_ID: appsY0VXF7pbv3mKR | |
AIRTABLE_MITH_BASE_ID: appMWsw8HKjjokBg2 | |
run: npm run build | |
- name: Adding Known Hosts | |
run: ssh-keyscan -H mith.umd.edu >> ~/.ssh/known_hosts | |
- name: Install SSH Key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_SECRET_KEY }} | |
- name: Deploy to server | |
run: | | |
rsync -avz --delete --quiet -e "ssh -i ${{ secrets.SSH_SECRET_KEY }} -o StrictHostKeyChecking=no" ./public/ [email protected]:/var/www/mith.umd.edu | |
- name: Clean up | |
run: rm -rf ./public/ |