diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e37e0b..e622a7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ on: concurrency: production_environment jobs: - build: + tests: runs-on: ubuntu-latest services: mysql: @@ -27,11 +27,9 @@ jobs: steps: # —— Setup GitHub actions 🐙 ————————————————————————————————————————————— - # https://github.com/actions/checkout (official) - name: Checkout uses: actions/checkout@v2 - # https://github.com/shivammathur/setup-php (community) - name: Setup PHP, extensions and composer with shivammathur/setup-php uses: shivammathur/setup-php@v2 with: @@ -115,26 +113,25 @@ jobs: deploy: name: Deploy to prod runs-on: ubuntu-latest - needs: build + needs: tests if: github.ref == 'refs/heads/master' steps: - - run: echo "Build job and tests ok on master, deploying to production server..." + - run: echo "Build job was a success on master, deploying..." - uses: actions/checkout@v2 - - name: Setup PHP - uses: shivammathur/setup-php@v2 + - name: Setup PHP and Deployer + uses: shivammathur/setup-php@master with: - php-version: "8.1" + php-version: 8.1 + tools: deployer:v7.3.0 - - name: Install dependencies + - name: Setup SSH connection + uses: webfactory/ssh-agent@v0.5.3 + with: + ssh-private-key: ${{ secrets.PRIVATE_KEY }} + + - name: Deploy to Production run: | + echo '${{ secrets.KNOWN_HOSTS }}' >> ~/.ssh/known_hosts cd app - composer install - - - name: Deploy - uses: deployphp/action@v1 - with: - dep: deploy - private-key: ${{ secrets.PRIVATE_KEY }} - deployer-binary: "bin/dep" - verbosity: -vvv + deployer deploy -v \ No newline at end of file