Update handler.php #10
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: Check syntax and sync files to web server | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
check-and-sync: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install SSH key | |
env: | |
CYB_SSH_KEY: ${{ secrets.CYB_SSH_KEY }} | |
run: | | |
mkdir -p ~/.ssh | |
echo "$CYB_SSH_KEY" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
- name: Check syntax | |
run: sudo apt install php-cli && php -l "$GITHUB_WORKSPACE/index.php" | |
- name: Setup known hosts | |
run: ssh-keyscan puffypenguin.cyb.no >> ~/.ssh/known_hosts | |
- name: Fix permissions for daemon user | |
run: ssh [email protected] doas -n chmod g+w /var/www/htdocs/ | |
- name: Sync files | |
run: rsync --rsync-path=/usr/bin/openrsync -v index.php handler.php [email protected]:/var/www/htdocs/ |