Skip to content

Merge pull request #362 from Quickchive/develop #41

Merge pull request #362 from Quickchive/develop

Merge pull request #362 from Quickchive/develop #41

Workflow file for this run

name: Docker Image CI && Deploy to EC2
on:
push:
branches: ['master']
# pull_request:
# branches: ['develop']
jobs:
job1:
name: Docker Image CI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: Build and push Docker images
uses: docker/[email protected]
with:
context: .
tags: quickarchive/quickarchive_api:main
# build on feature branches, push only on develop branch
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.PROD_HOST }}
username: ubuntu
key: ${{ secrets.PROD_KEY_PAIR }}
script: |
sh /home/ec2-user/deploy.sh