diff --git a/.github/workflows/rpgf4-production-deploy.yml b/.github/workflows/rpgf4-production-deploy.yml new file mode 100644 index 0000000..bd322e5 --- /dev/null +++ b/.github/workflows/rpgf4-production-deploy.yml @@ -0,0 +1,27 @@ +name: production-deploy-pipeline + +on: + push: + branches: + - master + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: SSH and Redeploy Production + uses: appleboy/ssh-action@v1.0.0 + with: + host: ${{ secrets.PROD_HOST }} + username: ${{ secrets.PROD_USERNAME }} + key: ${{ secrets.PROD_PRIVATE_KEY }} + port: ${{ secrets.SSH_PORT }} + script: | + cd rpgf4-pw-backend + docker-compose down -v + docker image prune -a --force + git checkout master + git reset --hard origin/master + git pull origin master + docker-compose build --no-cache + docker-compose up -d diff --git a/.github/workflows/rpgf4-staging-deploy.yml b/.github/workflows/rpgf4-staging-deploy.yml new file mode 100644 index 0000000..3293428 --- /dev/null +++ b/.github/workflows/rpgf4-staging-deploy.yml @@ -0,0 +1,27 @@ +name: staging-deploy-pipeline + +on: + push: + branches: + - staging + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: SSH and Redeploy Staging + uses: appleboy/ssh-action@v1.0.0 + with: + host: ${{ secrets.STAGING_HOST }} + username: ${{ secrets.STAGING_USERNAME }} + key: ${{ secrets.STAGING_PRIVATE_KEY }} + port: ${{ secrets.SSH_PORT }} + script: | + cd rpgf4-pw-backend + docker-compose down -v + docker image prune -a --force + git checkout staging + git reset --hard origin/staging + git pull origin staging + docker-compose build --no-cache + docker-compose up -d diff --git a/.github/workflows/rpgf5-production-deploy.yml b/.github/workflows/rpgf5-production-deploy.yml index d9f776c..b428577 100644 --- a/.github/workflows/rpgf5-production-deploy.yml +++ b/.github/workflows/rpgf5-production-deploy.yml @@ -2,9 +2,9 @@ name: rpgf5-prod-deploy-pipeline on: workflow_dispatch: -# push: -# branches: -# - master + push: + branches: + - master jobs: publish: @@ -43,8 +43,8 @@ jobs: script: | cd pw-backend git reset --hard HEAD~1 - git checkout rpgf5 - git pull origin rpgf5 + git checkout master + git pull origin master docker image prune -a --force docker compose -f docker-compose-prod.yml pull