Release Site #14
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: 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' |