Skip to content

feat(ci/cd): wait for ci on cd #1

feat(ci/cd): wait for ci on cd

feat(ci/cd): wait for ci on cd #1

Workflow file for this run

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