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

Commit a47b0aa

Browse files
committed
feat: デプロイコマンドを追加した
1 parent 52a9127 commit a47b0aa

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

.github/workflows/cd-staging.yml

+26-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on: # 検証用。マージ時に修正する。
88
jobs:
99
push-image:
1010
runs-on: ubuntu-latest
11+
environment: stg
1112
steps:
1213
- name: Checkout
1314
uses: actions/checkout@v4
@@ -16,8 +17,7 @@ jobs:
1617
uses: docker/metadata-action@v4
1718
with:
1819
images: ghcr.io/twin-te/twinte-back
19-
tags: |
20-
dev
20+
tags: stg
2121
- name: Set up Docker Buildx
2222
uses: docker/setup-buildx-action@v3
2323
- name: Login to GitHub Container Registry
@@ -35,3 +35,27 @@ jobs:
3535
tags: ${{ steps.docker_meta.outputs.tags }}
3636
cache-from: type=gha
3737
cache-to: type=gha,mode=max
38+
39+
deploy:
40+
runs-on: ubuntu-latest
41+
needs: push-image
42+
environment: stg
43+
steps:
44+
- name: Checkout
45+
uses: actions/checkout@v4
46+
- name: Deploy to app server
47+
uses: appleboy/[email protected]
48+
with:
49+
host: ${{ secrets.APP_HOST }}
50+
username: ${{ secrets.USERNAME }}
51+
key: ${{ secrets.KEY }}
52+
port: ${{ secrets.PORT }}
53+
script: ~/twinte-infra-v4/staging/app/scripts/deploy-back.sh
54+
- name: Deploy to db server
55+
uses: appleboy/[email protected]
56+
with:
57+
host: ${{ secrets.DB_HOST }}
58+
username: ${{ secrets.USERNAME }}
59+
key: ${{ secrets.KEY }}
60+
port: ${{ secrets.PORT }}
61+
script: ~/twinte-infra-v4/staging/db/scripts/deploy-back.sh

0 commit comments

Comments
 (0)