This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
[Fix] CD 워크플로 & 탬플릿 미세 조정 (#47) #2
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: Deploy | |
on: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- 'main' | |
jobs: | |
Deploy: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-22.04 | |
steps: | |
# Needed for `google-github-actions` | |
- uses: 'actions/checkout@v4' | |
- name: Login to Google | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: ${{ secrets.GCP_CREDENTIALS }} | |
- name: Update docker container | |
uses: google-github-actions/ssh-compute@v1 | |
with: | |
instance_name: plantory | |
zone: asia-northeast3-a | |
ssh_private_key: ${{ secrets.GCP_SSH_KEY }} | |
command: | | |
docker pull goldentrash/plantory:latest | |
docker stop plantory | |
docker run -d --rm -p 8080:8080 --mount type=volume,src=resources,dst=/app/resources --env-file plantory.env --name plantory goldentrash/plantory |