feat(ci/cd): wait for ci on cd #1
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
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "*" | |
name: π¦ Continuous Deployment | |
jobs: | |
cd: | |
runs-on: ubuntu-latest | |
steps: | |
- name: π₯ Checkout | |
uses: actions/checkout@v3 | |
- name: π Setup Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: π Login | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: β³ Wait for Continuous Integration | |
uses: lewagon/wait-on-check-action@v1.3.1 | |
with: | |
wait-interval: 10 | |
check-name: "π§ͺ Continuous Integration" | |
ref: ${{ github.ref }} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: ποΈ Build and Publish | |
run: | | |
docker buildx build -t banking-backend:${{ github.ref_name }} -t banking-backend:latest --load . | |
docker image tag banking-backend ghcr.io/simplytest/banking-backend | |
docker push -a ghcr.io/simplytest/banking-backend | |
- name: π SSH Setup | |
uses: appleboy/ssh-action@55dabf81b49d4120609345970c91507e2d734799 | |
with: | |
host: ${{ secrets.HOST }} | |
port: ${{ secrets.PORT }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
script: | | |
docker stop Banking-Backend-Demo || true | |
docker rm Banking-Backend-Demo || true | |
docker pull ghcr.io/simplytest/banking-backend:latest | |
docker run -d -p 5005:5005 -e "SIMPLYTEST_DEMO=ON" --rm --name=Banking-Backend-Demo ghcr.io/simplytest/banking-backend:latest |