更新 .gitea/workflows/main.yaml

This commit is contained in:
root 2024-07-06 23:39:13 +08:00
parent 349581ab59
commit 9189e08159
1 changed files with 5 additions and 5 deletions

View File

@ -15,7 +15,7 @@ jobs:
# REPO: "${{ vars.ALI_REPO }}"
CTN_NAME: "ctn-pms-demo"
IMG_NAME: "${{ github.repository }}:${{ github.ref_name }}"
REMOTE_IMG_NAME: ${{ vars.ALI_REGISTRY }}/${{ vars.ALI_REPO }}/${{ github.repository }}:${{ github.ref_name }}
REMOTE_IMG_NAME: "${{ vars.ALI_REGISTRY }}/${{ vars.ALI_REPO }}/${{ github.repository }}:${{ github.ref_name }}""
steps:
- name: install nodejs&golang and set proxy
run: |
@ -46,20 +46,20 @@ jobs:
run: |
docker stop $CTN_NAME || true
docker rm $CTN_NAME || true
docker rmi $REMOTE_IMG_NAME || true
# docker build -t $REMOTE_IMG_NAME . --file Dockerfile
docker rmi $IMG_NAME || true
# docker build -t $IMG_NAME . --file Dockerfile
- name: Build and Push Docker Image To Alibaba Cloud
uses: docker/build-push-action@v6
with:
push: true
context: . Dockerfile
tags: $REMOTE_IMG_NAME
tags: $IMG_NAME
# username: ${{ vars.ALI_USER }}
# password: ${{ vars.ALI_PWD }}
- name: Run On Server
run: |
docker run -d --name $CTN_NAME -p $HOST_PORT:8080 $REMOTE_IMG_NAME
docker run -d --name $CTN_NAME -p $HOST_PORT:8080 $IMG_NAME
# - name: SSH Deploy
# uses: easingthemes/ssh-deploy-action@v2.1.5
# env: