File tree Expand file tree Collapse file tree 1 file changed +46
-16
lines changed
Expand file tree Collapse file tree 1 file changed +46
-16
lines changed Original file line number Diff line number Diff line change 11on :
2- workflow_call :
3- inputs :
4- artifact :
5- required : true
6- type : string
7- environment :
8- required : true
9- type : string
2+ workflow_call :
3+ inputs :
4+ artifact :
5+ required : true
6+ type : string
7+ environment :
8+ required : true
9+ type : string
10+ secret_name :
11+ required : true
12+ type : string
1013jobs :
11- deploy_infra_artifact :
12- runs-on : ubuntu-latest
13- steps :
14- - name : Build compose filename
15- id : build-compose-filename
16- run : |
17- echo "Artifact: ${{ inputs.artifact }}"
18- echo "Environment: ${{ inputs.environment }}"
14+ deploy_infra_artifact :
15+ runs-on : ubuntu-latest
16+ steps :
17+ - name : Build compose filename
18+ id : build-compose-filename
19+ run : |
20+ echo "Artifact: ${{ inputs.artifact }}"
21+ echo "Environment: ${{ inputs.environment }}"
22+ filename="${{ inputs.artifact }}-compose-${{ inputs.environment }}.yml"
23+ echo "Generated filename: $filename"
24+ echo "COMPOSE_FILENAME=$filename" >> $GITHUB_ENV
25+
26+ - name : Transfer Compose File to Server
27+ 28+ with :
29+ host : ${{ secrets.SSH_HOST }}
30+ username : ${{ secrets.SSH_USERNAME }}
31+ key : ${{ secrets.SSH_KEY }}
32+ source : .github/workflows/infra/docker/postgres-compose-pre.yml
33+ target : /opt/summoners-sync/infra/docker/${{ env.COMPOSE_FILENAME }}
34+ rm : true
35+
36+ # Deploy Infra
37+ - name : Deploy Infra
38+ 39+ with :
40+ host : ${{ secrets.SSH_HOST }}
41+ username : ${{ secrets.SSH_USERNAME }}
42+ key : ${{ secrets.SSH_KEY }}
43+ script : |
44+ cd /opt/summoners-sync/infra/docker
45+
46+ echo "${{ secrets[inputs.secret_name] }}" > .env
47+
48+ docker-compose --env-file .env -f ${{ env.COMPOSE_FILENAME }} up -d
You can’t perform that action at this time.
0 commit comments