Add action deployment
This commit is contained in:
parent
530bb653dd
commit
71286ca112
5 changed files with 55 additions and 7 deletions
22
.github/workflows/build.yaml
vendored
22
.github/workflows/build.yaml
vendored
|
|
@ -6,12 +6,15 @@ on:
|
|||
# - v1.**
|
||||
# branches:
|
||||
# - 'main'
|
||||
# branches:
|
||||
# - 'release-*'
|
||||
|
||||
# Allow run workflow manually from Action tab
|
||||
workflow_dispatch:
|
||||
env:
|
||||
REGISTRY: docker.frappet.com
|
||||
CMS_IMAGE_NAME: demo/qualifying-exam-cms
|
||||
CMS_IMAGE_TAG: 0.1.0
|
||||
CMS_IMAGE_TAG: 0.1.1
|
||||
jobs:
|
||||
# act --workflows .github/workflows/build.yaml --job remote-image -s DOCKER_USER -s DOCKER_PASS
|
||||
# act -W .github/workflows/build.yaml -j remote-image -s DOCKER_USER -s DOCKER_PASS
|
||||
|
|
@ -38,6 +41,20 @@ jobs:
|
|||
# platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{env.REGISTRY}}/${{env.CMS_IMAGE_NAME}}:${{env.CMS_IMAGE_TAG}},${{env.REGISTRY}}/${{env.CMS_IMAGE_NAME}}:latest
|
||||
- name: Remote Deployment
|
||||
uses: appleboy/ssh-action@v0.1.8
|
||||
with:
|
||||
host: frappet.com
|
||||
username: frappet
|
||||
password: ${{ secrets.SSH_PASSWORD }}
|
||||
port: 22
|
||||
script: |
|
||||
cd /home/frappet/docker/bma-ehr-recruit-qualifying-exam
|
||||
docker-compose pull
|
||||
docker-compose up -d
|
||||
touch success
|
||||
|
||||
|
||||
# act -W .github/workflows/build.yaml -j local-image
|
||||
local-image:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
@ -52,4 +69,5 @@ jobs:
|
|||
with:
|
||||
context: cms
|
||||
load: true
|
||||
tags: ${{env.REGISTRY}}/${{env.CMS_IMAGE_NAME}}:${{env.CMS_IMAGE_TAG}},${{env.REGISTRY}}/${{env.CMS_IMAGE_NAME}}:latest
|
||||
tags: ${{env.REGISTRY}}/${{env.CMS_IMAGE_NAME}}:${{env.CMS_IMAGE_TAG}},${{env.REGISTRY}}/${{env.CMS_IMAGE_NAME}}:latest
|
||||
|
||||
|
|
|
|||
23
.github/workflows/deploy.yaml
vendored
Normal file
23
.github/workflows/deploy.yaml
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
name: build-docker
|
||||
run-name: build-docker ${{ github.actor }}
|
||||
on:
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
# https://github.com/appleboy/ssh-action
|
||||
# act -W .github/workflows/deploy.yaml -j remote-deploy -s SSH_PASSWORD
|
||||
remote-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Remote Deployment
|
||||
uses: appleboy/ssh-action@v0.1.8
|
||||
with:
|
||||
host: frappet.com
|
||||
username: frappet
|
||||
password: ${{ secrets.SSH_PASSWORD }}
|
||||
port: 22
|
||||
script: |
|
||||
cd /home/frappet/docker/bma-ehr-recruit-qualifying-exam
|
||||
docker-compose pull
|
||||
docker-compose up -d
|
||||
touch success
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue