From 388e966f61deac4d43a66865aa2e798d9e8eab9a Mon Sep 17 00:00:00 2001 From: Noel Palo Date: Mon, 11 Sep 2023 11:08:59 +0800 Subject: [PATCH] Create weather-app-ci-build.yml feature/BWA-8-weather-app-github-action - Create weather-app-ci-build.yml --- .github/workflows/weather-app-ci-build.yml | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/weather-app-ci-build.yml diff --git a/.github/workflows/weather-app-ci-build.yml b/.github/workflows/weather-app-ci-build.yml new file mode 100644 index 0000000..f4f9912 --- /dev/null +++ b/.github/workflows/weather-app-ci-build.yml @@ -0,0 +1,63 @@ +name: Weather App CI + +on: + push: + branches: [ "master", "development" ] + pull_request: + branches: [ "master", "development" ] + +jobs: + + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Docker Login + env: + DOCKER_USER: ${{ secrets.DOCKER_USER }} + DOCKER_KEY: ${{ secrets.DOCKER_KEY }} + run: | + docker login -u $DOCKER_USER -p $DOCKER_KEY + + # Script Permissions + - name: Add Permission to Shell Scripts + run: chmod +x -R ./scripts/*.sh + + # Docker Images + - name: Building the Docker Images + run: ./scripts/build.sh + + # Docker Containers + - name: Start Docker Containers + run: ./scripts/up.sh -d + + # Composer + - name: Run Composer + run: | + ./scripts/composer.sh install + ./scripts/composer.sh dump-autoload + + # NPM + - name: Run NPM + run: | + ./scripts/run.sh npm install + ./scripts/run.sh npm run build + + # Code Quality Check + - name: Run PhpStan + run: ./scripts/composer.sh run phpstan + + - name: Run Easy Coding Sandards + run: ./scripts/composer.sh run ecs-all + + - name: Run Automated Test with PhpUnit + run: ./scripts/composer.sh run phpunit + + # Teardown + - name: Stop container and remove images + run: ./scripts/down.sh -v + + +