Skip to content

Commit

Permalink
chore: update yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Kang1221 committed Sep 13, 2024
1 parent cc6aab8 commit 175b95d
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,19 @@ jobs:
docker tag ${{ secrets.DOCKERHUB_REPOSITORY }} ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${GITHUB_SHA::7}
docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${GITHUB_SHA::7}
# Deploy
deploy_production:
# Deploy_staging
deploy_staging:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/deploy'
if: github.ref == 'refs/heads/develop'
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VM_INSTANCE }}
host: ${{ secrets.DEVELOP_VM_INSTANCE }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
envs: GITHUB_SHA
Expand All @@ -63,19 +62,20 @@ jobs:
sudo docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${GITHUB_SHA::7}
sudo docker tag ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${GITHUB_SHA::7} ddanzi
sudo docker-compose up -d --remove-orphans
# Deploy
deploy_staging:
# Deploy_production
deploy_production:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/develop'
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEVELOP_VM_INSTANCE }}
host: ${{ secrets.VM_INSTANCE }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
envs: GITHUB_SHA
Expand All @@ -84,5 +84,4 @@ jobs:
sudo docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }}
sudo docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${GITHUB_SHA::7}
sudo docker tag ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${GITHUB_SHA::7} ddanzi
sudo docker-compose up -d --remove-orphans
sudo docker-compose up -d --remove-orphans

0 comments on commit 175b95d

Please sign in to comment.