test: list folders #24
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: Deploy to Hosting | |
on: | |
push: | |
branches: | |
- "*" | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "7.4" # Set the appropriate PHP version here | |
- name: Install dependencies | |
run: composer install --no-dev --prefer-dist --optimize-autoloader | |
- name: List files and folders | |
run: ls -la | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
name: id_rsa # optional | |
known_hosts: ${{ secrets.SSH_HOST }} | |
if_key_exists: fail # replace / ignore / fail; optional (defaults to fail) | |
- name: rsync over SSH | |
run: rsync --rsh='ssh -p${{ secrets.HOST_PORT }}' /etc/passwd ${{ secrets.HOST_USER }}@${{ secrets.HOST_IP }}:/${{ secrets.TARGET_DIRECTORY }} | |
- name: Deploy to Hosting | |
run: | | |
ssh -vvv -p ${{secrets.HOST_PORT}} ${{ secrets.HOST_USER }}@${{ secrets.HOST_IP }} "cd ${{ secrets.TARGET_DIRECTORY }} && git pull" | |
env: | |
HOST_USER: ${{ secrets.HOST_USER }} | |
HOST_IP: ${{ secrets.HOST_IP }} | |
HOST_PORT: ${{ secrets.HOST_PORT }} | |
TARGET_DIRECTORY: ${{ secrets.TARGET_DIRECTORY }} |