From 71c66706ce409fc1f96d209d38606e22a0d5a58c Mon Sep 17 00:00:00 2001 From: Zafei-Erin <897659752@qq.com> Date: Wed, 21 Feb 2024 23:33:56 +0800 Subject: [PATCH] aws --- .github/workflows/production.yml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index c7a7a86..ab20942 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -5,7 +5,7 @@ on: types: [labeled] jobs: - deploy-aws: + deploy-git: if: "${{ github.event.label.name == 'prod: backend' }}" runs-on: ubuntu-latest @@ -17,11 +17,19 @@ jobs: uses: actions-ecosystem/action-remove-labels@v1 with: labels: "prod: backend" - - # - name: Deploy to EC2 instance - # runs-on: aws-nft - # run: sudo docker-compose stop - # run: sudo docker-compose rm -f - # run: sudo docker-compose pull - # run: sudo docker-compose up -d - # run: sudo docker image prune -af \ No newline at end of file + + deploy-aws: + needs: build + runs-on: aws-nft + + steps: + - name: stop old image + run: sudo docker-compose stop + - name: remove old image + run: sudo docker-compose rm -f + - name: pull new image + run: sudo docker-compose pull + - name: run new image + run: sudo docker-compose up -d + - name: prune images + run: sudo docker image prune -af \ No newline at end of file