Skip to content

Commit f34d984

Browse files
committed
.github
new actions
1 parent 7843682 commit f34d984

File tree

2 files changed

+59
-20
lines changed

2 files changed

+59
-20
lines changed

.github/workflows/publish.yml

+27-20
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,37 @@
1-
name: Gatsby Publish
1+
name: Build and Site
22

33
on:
44
push:
55
branches:
6-
- master
6+
- main
77

88
jobs:
9-
build:
9+
build-and-deploy:
1010
runs-on: ubuntu-latest
11+
12+
env:
13+
MY_ENV_VAR: "some_value"
14+
1115
steps:
12-
- uses: actions/checkout@v3
13-
- uses: SpicyPizza/[email protected]
14-
with:
15-
envkey_AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }}
16-
envkey_AIRTABLE_PEOPLE_BASE_ID: appk2btw36qEO3vFo
17-
envkey_AIRTABLE_RESEARCH_BASE_ID: appTv9J1zxqaNgBHi
18-
envkey_AIRTABLE_POSTS_BASE_ID: appsY0VXF7pbv3mKR
19-
- uses: actions/setup-node@v3
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v3
2021
with:
21-
node-version: 16.x
22-
- name: npm install and build and deploy
23-
run: |
24-
npm install
25-
npm run build
26-
- uses: peaceiris/actions-gh-pages@v2
22+
node-version: '20.x'
23+
24+
- name: Install dependencies
25+
run: npm install
26+
27+
- name: Build project
28+
run: npm run build
29+
30+
- name: Deploy to server
2731
env:
28-
ACTIONS_DEPLOY_KEY: ${{ secrets.ACCESS_TOKEN }}
29-
PUBLISH_BRANCH: gh-pages
30-
PUBLISH_DIR: ./public
32+
RSYNC_RSH: "ssh -i ${{ secrets.SSH_SECRET_KEY }} -o StrictHostKeyChecking=no"
33+
run: |
34+
rsync -avz --delete --quiet ./public/ [email protected]:/var/www/mith.umd.edu
35+
36+
- name: Clean up
37+
run: rm -rf ./public/

.github/workflows/staging.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish Staging Site on GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: SpicyPizza/[email protected]
14+
with:
15+
envkey_AIRTABLE_TOKEN: ${{ secrets.AIRTABLE_API_KEY }}
16+
envkey_AIRTABLE_PEOPLE_BASE_ID: appk2btw36qEO3vFo
17+
envkey_AIRTABLE_RESEARCH_BASE_ID: appTv9J1zxqaNgBHi
18+
envkey_AIRTABLE_EVENTS_BASE_ID: tbl6CURONRn8ML6le
19+
envkey_AIRTABLE_POSTS_BASE_ID: appsY0VXF7pbv3mKR
20+
envkey_AIRTABLE_MITH_BASE_ID: appMWsw8HKjjokBg2
21+
- uses: actions/setup-node@v3
22+
with:
23+
node-version: 16.x
24+
- name: npm install and build and deploy
25+
run: |
26+
npm install
27+
npm run build
28+
- uses: peaceiris/actions-gh-pages@v4
29+
env:
30+
ACTIONS_DEPLOY_KEY: ${{ secrets.ACCESS_TOKEN }}
31+
PUBLISH_BRANCH: gh-pages
32+
PUBLISH_DIR: ./public

0 commit comments

Comments
 (0)