Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
feat: デプロイコマンドを追加した
Browse files Browse the repository at this point in the history
  • Loading branch information
arata-nvm committed Mar 4, 2024
1 parent 52a9127 commit a47b0aa
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/cd-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on: # 検証用。マージ時に修正する。
jobs:
push-image:
runs-on: ubuntu-latest
environment: stg
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -16,8 +17,7 @@ jobs:
uses: docker/metadata-action@v4
with:
images: ghcr.io/twin-te/twinte-back
tags: |
dev
tags: stg
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
Expand All @@ -35,3 +35,27 @@ jobs:
tags: ${{ steps.docker_meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max

deploy:
runs-on: ubuntu-latest
needs: push-image
environment: stg
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy to app server
uses: appleboy/[email protected]
with:
host: ${{ secrets.APP_HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: ~/twinte-infra-v4/staging/app/scripts/deploy-back.sh
- name: Deploy to db server
uses: appleboy/[email protected]
with:
host: ${{ secrets.DB_HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: ~/twinte-infra-v4/staging/db/scripts/deploy-back.sh

0 comments on commit a47b0aa

Please sign in to comment.