Skip to content

Commit bfe5c07

Browse files
committed
fix: deploy to stacks enabled
1 parent b5f7317 commit bfe5c07

1 file changed

Lines changed: 22 additions & 11 deletions

File tree

.github/workflows/release-flask.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ on:
2525
stacks-repo:
2626
type: string
2727
required: false
28-
default: "git@github.com:coingaming/stacks.git"
28+
default: "coingaming/stacks"
2929
stacks-name:
3030
type: string
3131
required: false
3232
default: ${{ inputs.app-name }}
33+
stacks-branch-name:
34+
type: string
35+
required: false
36+
default: ${{ inputs.app-name }}
3337
app-name:
3438
type: string
3539
required: true
@@ -107,8 +111,8 @@ jobs:
107111
GH_PAT: ${{ secrets.GH_TOKEN }}
108112
GIT_TERMINAL_PROMPT: 0
109113
run: |
110-
git config --global --replace-all url."https://${GH_PAT}@github.com/".insteadOf git@github.com:
111-
git config --global --add url."https://${GH_PAT}@github.com/".insteadOf "https://github.com/"
114+
git config --global user.email "actions@github.com"
115+
git config --global user.name ${{ github.actor }}
112116
113117
- name: Get & build for asset
114118
run: |
@@ -138,13 +142,20 @@ jobs:
138142
--file ci.Dockerfile .
139143
docker push ${{ env.IMAGE }}
140144
141-
# - name: Deploy to stacks
142-
# run: |
143-
# git clone git@github.com:coingaming/${{ inputs.stacks-repo }}
144-
# cd ${{ inputs.stacks-repo }}
145-
# git checkout ${{ inputs.stacks-branch-name }}
145+
- name: Clone Stacks Repo
146+
working-directory: .
147+
run: |
148+
git clone https://${{secrets.GH_TOKEN }}@github.com/${{ inputs.stacks-repo }}.git stacks
149+
cd stacks
150+
git checkout ${{ inputs.stacks-branch-name }}
146151
147-
# scripts/update-image ${{ inputs.stacks-name }} ${{inputs.service-name }} ${{ env.IMAGE }}
152+
- name: Update Docker Image
153+
uses: mikefarah/yq@master
154+
with:
155+
cmd: yq '.services.${{ inputs.service-name }}.image="${{ env.IMAGE }}"' -i stacks/docker-compose.${{ inputs.stacks-name }}.yml
148156

149-
# git commit -am "upgraded ${{inputs.service-name }} service with ${{ env.IMMAGE }}"
150-
# git push origin refs/heads/${{ inputs.stacks-branch-name }}:refs/heads/${{ inputs.stacks-branch-name }}
157+
- name: Deploy to stacks
158+
working-directory: stacks
159+
run: |
160+
git commit -am "upgraded ${{inputs.service-name }} service with ${{ env.IMAGE }}"
161+
git push origin refs/heads/${{ inputs.stacks-branch-name }}:refs/heads/${{ inputs.stacks-branch-name }}

0 commit comments

Comments
 (0)