-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9bbc969
commit 5dbfc27
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Mysql To ElasticSearch Batch Job | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '0 2 * * *' | ||
|
||
jobs: | ||
batch-job: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Docker Build And Push | ||
run: | | ||
docker login -u ${{ secrets.USERNAME }} -p ${{ secrets.PASSWORD }} | ||
docker build -f mysql-to-es.Dockerfile -t skku-mysql-to-es-batch . | ||
docker tag skku-mysql-to-es-batch sinkyoungdeok/skku-mysql-to-es-batch | ||
docker push sinkyoungdeok/skku-mysql-to-es-batch | ||
- name: Deploy Prod | ||
uses: appleboy/ssh-action@v0.1.4 | ||
with: | ||
key: ${{ secrets.SSH_KEY }} | ||
host: ${{ secrets.HOST_NAME }} | ||
username: ubuntu | ||
port: 22 | ||
script: | | ||
docker login -u ${{ secrets.USERNAME }} -p ${{ secrets.PASSWORD }} | ||
docker pull sinkyoungdeok/skku-mysql-to-es-batch | ||
docker run --net ubuntu_default sinkyoungdeok/skku-mysql-to-es-batch |