Merge pull request #2 from hexrom/feature/github-action #1
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: CI Workflow | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
all-in-one: | |
runs-on: ubuntu-latest | |
services: | |
docker: | |
image: docker:dind | |
options: --tls=false | |
env: | |
DOCKER_TLS_CERTDIR: "" | |
ports: | |
- 2375:2375 | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up Docker environment | |
run: | | |
echo "DOCKER_DRIVER=overlay2" >> $GITHUB_ENV | |
echo "DOCKER_HOST=tcp://localhost:2375/" >> $GITHUB_ENV | |
- name: Run Docker Compose and WPScan | |
run: | | |
docker-compose up -d --build | |
until docker-compose exec mysql mysql -u root -ppassword -e 'SELECT 1'; do | |
echo "Waiting for MySQL to be ready..." | |
sleep 5 | |
done | |
docker-compose run --rm wp-cli install-wp | |
sleep 10 | |
docker pull wpscanteam/wpscan | |
sleep 5 | |
docker run --network dvwp_default wpscanteam/wpscan wpscan --url http://wordpress/ | |
docker-compose down |