added stage profile #2
Workflow file for this run
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: e2e | |
on: | |
push: | |
branches-ignore: | |
- master | |
jobs: | |
deploy-services: | |
runs-on: self-hosted | |
steps: | |
- name: Push required props to GITHUB_ENV | |
run: | | |
echo "PROFILE=stage" >> $GITHUB_ENV | |
- name: Check changes path | |
uses: dorny/paths-filter@v3 | |
id: changes | |
with: | |
filters: | | |
auth: | |
- 'rococo-auth/**' | |
api: | |
- 'rococo-api/**' | |
client: | |
- 'rococo-client/**' | |
- name: Docker login | |
run: | | |
docker login --username ${{ vars.DOCKER_HUB_ACC }} --password "${{ secrets.DOCKER_HUB_PASSWORD }}" | |
- name: build auth & deploy to staging | |
if: steps.changes.outputs.auth == 'true' | |
working-directory: ./ | |
run: | | |
pwd | |
bash ./gradlew :rococo-auth:jib -Pskipjaxb -x :rococo-e2e:test | |
docker-compose pull auth.rococo.dc | |
docker-compose stop auth.rococo.dc && docker-compose up -d --no-deps auth.rococo.dc | |
docker system prune -a -f | |
echo "Deploy auth to stage done!" | |
- name: build currency & deploy to staging | |
if: steps.changes.outputs.api == 'true' | |
working-directory: ./ | |
run: | | |
pwd | |
bash ./gradlew :rococo-api:jib -Pskipjaxb -x :rococo-e2e:test | |
docker-compose pull api.rococo.dc | |
docker-compose stop api.rococo.dc && docker-compose up -d --no-deps api.rococo.dc | |
docker system prune -a -f | |
echo "Deploy api to stage done!" | |
- name: build frontend & deploy to staging | |
if: steps.changes.outputs.client == 'true' | |
working-directory: ./rococo-client | |
run: | | |
pwd | |
docker build -t ${{ vars.DOCKER_HUB_ACC }}/rococo-client:0.0.1-SNAPSHOT -t ${{ vars.DOCKER_HUB_ACC }}/rococo-client:latest . | |
docker push ${{ vars.DOCKER_HUB_ACC }}/rococo-client:0.0.1-SNAPSHOT | |
docker push ${{ vars.DOCKER_HUB_ACC }}/rococo-client:latest | |
cd ../ || exit 1 | |
docker-compose pull client.rococo.dc | |
docker-compose stop client.rococo.dc && docker-compose up -d --no-deps client.rococo.dc | |
docker system prune -a -f | |
echo "Deploy frontend to stage done!" |