Merge pull request #246 from Quickchive/refactor-#245/divide-domain #71
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI && Deploy to EC2 for Test Server | |
on: | |
push: | |
branches: ['release/**', develop] | |
jobs: | |
job1: | |
name: Docker Image CI | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2.0.0 | |
with: | |
username: ${{secrets.DOCKERHUB_USERNAME}} | |
password: ${{secrets.DOCKERHUB_TOKEN}} | |
- name: Build and push Docker images | |
uses: docker/build-push-action@v3.1.1 | |
with: | |
context: . | |
tags: hou27/test_quickchive_backend:latest | |
push: true | |
job2: | |
needs: job1 | |
name: Deploy to EC2 | |
runs-on: ubuntu-latest | |
steps: | |
- name: executing remote ssh commands using password | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ubuntu | |
key: ${{ secrets.KEY_PAIR }} | |
script: | | |
sh /home/ubuntu/actions-runner/deploy_test_server.sh |