update CORS #9
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
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
run_pull: | |
name: run pull | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: install ssh keys | |
# check this thread to understand why its needed: | |
# https://stackoverflow.com/a/70447517 | |
run: | | |
install -m 600 -D /dev/null ~/.ssh/id_rsa | |
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa | |
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts | |
- name: zip repo and deploy | |
run: | | |
zip -r server.zip . | |
scp server.zip ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/${{secrets.SSH_USER}}/ | |
ssh ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}} "./deploy.sh" | |
- name: cleanup | |
run: rm -rf ~/.ssh |