Merge remote-tracking branch 'github/master'
This commit is contained in:
commit
2d0d88042a
31
.github/workflows/master.yml
vendored
Normal file
31
.github/workflows/master.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
name: CI/CD Pipeline
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master # 监视的分支
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Deploy to Server
|
||||||
|
uses: appleboy/ssh-action@v0.1.5
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.SSH_HOST }}
|
||||||
|
username: ${{ secrets.SSH_USERNAME }}
|
||||||
|
password: ${{ secrets.SSH_PASSWORD }}
|
||||||
|
script: |
|
||||||
|
cd /data/projects/itfx
|
||||||
|
git pull origin master
|
||||||
|
docker build -t interfaceforward_api:latest -f src/InterfaceForward.Api/Dockerfile .
|
||||||
|
# 标记镜像
|
||||||
|
docker tag interfaceforward_api:latest localhost:5000/interfaceforward_api:latest
|
||||||
|
# 推送镜像
|
||||||
|
docker push localhost:5000/interfaceforward_api:latest
|
||||||
|
docker service update --force --image interfaceforward_api:latest itfx_interfaceforward_api # 一定要和service name一致
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user