Skip to content

OiCMudkips is deploying victorzhou.dev #13

OiCMudkips is deploying victorzhou.dev

OiCMudkips is deploying victorzhou.dev #13

Workflow file for this run

name: Deploy to
run-name: ${{ github.actor }} is deploying victorzhou.dev
on:
workflow_dispatch:
push:
branches:
- master
jobs:
"Deploy-Static-Site":
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up SSH hosts and SSH identity
env:
VICTORZHOUDEV_SSH_KEY_PASSPHRASE: ${{ secrets.VICTORZHOUDEV_SSH_KEY_PASSPHRASE }}
run: |
mkdir ~/.ssh
ssh-keyscan "${{ secrets.VICTORZHOUDEV_SSH_HOST }}" >> ~/.ssh/known_hosts
SSH_KEY=`mktemp -p "${GITHUB_WORKSPACE}" id_rsaXXXXXX`
echo "${{ secrets.VICTORZHOUDEV_SSH_KEY }}" >> "${SSH_KEY}"
SSH_AGENT_SETUP=$(ssh-agent)
eval "${SSH_AGENT_SETUP}"
DISPLAY=1 SSH_ASKPASS="${GITHUB_WORKSPACE}/.github/util/print_ssh_passphrase.sh" ssh-add "${SSH_KEY}"
echo "SSH_AGENT_SETUP=${SSH_AGENT_SETUP}" >> $GITHUB_ENV
- name: Deploy main website
env:
SSH_AGENT_SETUP: ${{ env.SSH_AGENT_SETUP }}
run: |
eval "${SSH_AGENT_SETUP}"
ssh -vvv "${{ secrets.VICTORZHOUDEV_SSH_ADDRESS }}" "rm /home/public/*"
scp -vvv "${GITHUB_WORKSPACE}/src/*" "${{ secrets.VICTORZHOUDEV_SSH_ADDRESS }}:/home/public/"
- name: Install Python environment
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install Python dependencies
run: pip install -r "${GITHUB_WORKSPACE}/feed/requirements.txt"
- name: Generate and upload RSS feed files
env:
SSH_AGENT_SETUP: ${{ env.SSH_AGENT_SETUP }}
run: |
eval "${SSH_AGENT_SETUP}"
ATOM_OUTPUT_PATH="${GITHUB_WORKSPACE}/feed/atom.xml" RSS_OUTPUT_PATH="${GITHUB_WORKSPACE}/feed/rss.xml" python "${GITHUB_WORKSPACE}/feed/generate.py"
scp "${GITHUB_WORKSPACE}/feed/atom.xml" "${{ secrets.VICTORZHOUDEV_SSH_ADDRESS }}:/home/public/feed/"
scp "${GITHUB_WORKSPACE}/feed/rss.xml" "${{ secrets.VICTORZHOUDEV_SSH_ADDRESS }}:/home/public/feed/"