is this what i want now #4
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: update website contents | |
on: [push] | |
jobs: | |
update-website: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: 'configure ssh' | |
run: | | |
mkdir -p ~/.ssh/ | |
echo "$SSH_KEY" > ~/.ssh/key | |
chmod 600 ~/.ssh/key | |
echo "$SSH_HKEY" > ~/.ssh/known_hosts | |
cat >> ~/.ssh/config << END | |
Host website | |
Port $SSH_PORT | |
Hostname $SSH_HOST | |
User $SSH_USER | |
IdentityFile ~/.ssh/key | |
END | |
- name: 'pull content' | |
run: ssh website $SSH_CMD | |
env: | |
SSH_USER: ${{secrets.SSH_USER}} | |
SSH_KEY: ${{secrets.SSH_KEY}} | |
SSH_HKEY: ${{secrets.SSH_HKEY}} | |
SSH_HOST: ${{secrets.SSH_HOST}} | |
SSH_PORT: ${{secrets.SSH_PORT}} | |
SSH_CMD: ${{secrets.SSH_CMD}} | |