-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci: Build and push Docker image for PROD Co-authored-by: hseungho <[email protected]> * ci: Build and push Docker image for Dev Co-authored-by: hseungho <[email protected]> * cd: Deploy production Docker image to AWS EC2 Co-authored-by: hseungho <[email protected]> * cd: Deploy dev Docker image to AWS EC2 Co-authored-by: hseungho <[email protected]> * test: Update ci/cd Dev workflow trigger for test Co-authored-by: hseungho <[email protected]> * fix: Update dev deployment workflow Co-authored-by: hseungho <[email protected]> * fix: Update dev deployment workflow * Revert "fix: Update dev deployment workflow" This reverts commit 4a3380b. * fix: Update dev CI workflow * fix: Update dev CI workflow * fix: Update dev CI workflow * fix: Update dev CI workflow * fix: Update dev CI workflow * fix: Update dev CI workflow * fix: Update dev CI workflow * fix: Update dev CI workflow * fix: Update dev CI workflow * fix: Update dev CI workflow * fix: Update dev CI workflow * fix: Update dev CI workflow * fix: Update dev CI workflow * fix: Update dev CI workflow * fix: Update dev CI workflow * fix: Update dev CI workflow --------- Co-authored-by: hseungho <[email protected]>
- Loading branch information
1 parent
5dc6b9b
commit a697bda
Showing
4 changed files
with
78 additions
and
5 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,43 @@ | ||
name: Deploy dev | ||
|
||
on: | ||
workflow_run: | ||
workflows: | ||
- Build and Push Docker Image for DEV | ||
types: | ||
- completed | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
|
||
env: | ||
DOCKER_REGISTRY: ghcr.io | ||
DOCKER_REPO: liberty52/liberty52-product-server | ||
|
||
steps: | ||
- name: Get latest Release tag | ||
id: latest-tag | ||
uses: robinraju/[email protected] | ||
with: | ||
latest: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set Docker Image Name | ||
id: new-docker-image | ||
run: echo "::set-output name=image_name::$DOCKER_REGISTRY/$DOCKER_REPO:dev-${{ steps.latest-tag.outputs.tag_name }}" | ||
|
||
- name: Deploy AWS EC2 dev | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.REMOTE_IP_DEV }} | ||
username: ${{ secrets.REMOTE_SSH_ID_DEV }} | ||
key: ${{ secrets.REMOTE_SSH_KEY_DEV }} | ||
port: ${{ secrets.REMOTE_SSH_PORT_DEV }} | ||
script: | | ||
echo ${{ secrets.GTOKEN }} | sudo docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
sudo docker pull ${{ steps.new-docker-image.outputs.image_name }} | ||
container_name=$(sudo docker ps | grep liberty52 | awk '{print $NF}') | ||
sudo docker stop $container_name | ||
sudo docker run -d -p 8080:8080 ${{ steps.new-docker-image.outputs.image_name }} |
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,30 @@ | ||
name: Deploy prod | ||
|
||
on: | ||
workflow_run: | ||
workflows: | ||
- "Build and Push Docker Image for PROD" | ||
types: | ||
- completed | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
env: | ||
DOCKER_IMAGE: ghcr.io/liberty52/liberty52-product-server:prod-${{ github.sha }} | ||
|
||
steps: | ||
- name: Deploy AWS EC2 dev | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.REMOTE_IP_PROD }} | ||
username: ${{ secrets.REMOTE_SSH_ID_PROD }} | ||
key: ${{ secrets.REMOTE_SSH_KEY_PROD }} | ||
port: ${{ secrets.REMOTE_SSH_PORT_PROD }} | ||
script: | | ||
echo ${{ secrets.GTOKEN }} | sudo docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
sudo docker pull $DOCKER_IMAGE | ||
container_name=$(sudo docker ps | grep liberty52 | awk '{print $NF}') | ||
sudo docker stop $container_name | ||
sudo docker run -d -p 8080:8080 $DOCKER_IMAGE |
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
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