Basically, trying to use Github Actions to make CI/CD on a basic skeleton Symfony project.
Step 1. Checkout the code (use the standard action for checkout) - works splendidly
Step 2. run “bin/phpunit” in the runner environment - fails with insufficient access error, I am guessing it should be made executable first, to be able to run it? or maybe some other error. Did anyone succeed with running PHPUnit tests?
Step 3. make a condition that output of phpunit test contains “OK” string - documentation says there is an option to use “contains” function, but I am having trouble how to make exact syntax for this condition in the workflow
Step 3 Part 2. connect via SSH to remote host and execute a command - also no idea how to make it possible. it seems to be that I need to run either docker command or something? I am wondering if I can directly use SSH connection here? What is everyone using to make actual deployment? Most workflows in examples are CI workflows, not finding anything for CD workflows.
Current workflow, if abbreviated of details is like this:
name: CI/CD on: [push] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: test run: bin/phpunit - name: deploy if success tests if: steps.test.output.contains("OK") run: | ssh site.com cd /var/www/site && git pull origin master