Add deployment steps to build workflow for Docker containers
This commit is contained in:
parent
29b97ded2a
commit
d35a9ae532
1 changed files with 18 additions and 1 deletions
|
@ -32,3 +32,20 @@ jobs:
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: git.siwatsystem.com/adsist-cms/worker:latest
|
tags: git.siwatsystem.com/adsist-cms/worker:latest
|
||||||
|
|
||||||
|
deploy-stack:
|
||||||
|
needs: build-docker
|
||||||
|
runs-on: adsist
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Set up SSH connection
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "${{ secrets.DEPLOY_KEY_CMS }}" > ~/.ssh/id_rsa
|
||||||
|
chmod 600 ~/.ssh/id_rsa
|
||||||
|
ssh-keyscan -H ${{ vars.DEPLOY_HOST_CMS }} >> ~/.ssh/known_hosts
|
||||||
|
- name: Deploy stack
|
||||||
|
run: |
|
||||||
|
echo "Pulling and starting containers on server..."
|
||||||
|
ssh -i ~/.ssh/id_rsa ${{ vars.DEPLOY_USER_CMS }}@${{ vars.DEPLOY_HOST_CMS }} "cd ~/cms-system-k8s && docker compose pull && docker compose up -d"
|
Loading…
Add table
Add a link
Reference in a new issue