-
Notifications
You must be signed in to change notification settings - Fork 61
43 lines (38 loc) · 1.42 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Release Site
on:
workflow_run:
workflows: ["Build Site"]
types:
- completed
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
environment:
name: legion
url: https://pros.cs.purdue.edu
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
# name: pros-docs.tar.gz
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: Compress Artifact
run: |
cd pros-docs
tar -czf ../pros-docs.tar.gz *
cd ..
# Because PurdueCS only allows access to legion on campus we have to do some port forwarding through a jumphost.
# The jumphost has been set up on a student's data server. Only the vars.SSH_USER has to be updated when needed here.
- name: Send Artifact to Server
run: |
echo "${{ secrets.SSH_KEY }}" > key
chmod 400 key
scp -o "StrictHostKeyChecking no" -i key -A -J ${{ vars.JUMP_USER }}@${{ vars.JUMP_HOST}} pros-docs.tar.gz ${{ vars.SSH_USER }}@${{ vars.SSH_HOST }}:~/pros-website
- name: Deploy!
run: |
echo "${{ secrets.SSH_KEY }}" > key
chmod 400 key
ssh -o "StrictHostKeyChecking no" -i key -A -J ${{ vars.JUMP_USER }}@${{ vars.JUMP_HOST}} ${{ vars.SSH_USER }}@${{ vars.SSH_HOST }} '~/pros-website/deploy.sh'