Merge pull request #10 from 3rg1s/feature/0-test #20
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: | ||
- "*" | ||
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: 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.145.14.156.206 }}:/${{ secrets.TARGET_DIRECTORY }} | ||
Check failure on line 31 in .github/workflows/deploy.yml GitHub Actions / Deploy to HostingInvalid workflow file
|
||
- 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 }} |