From 5677d82c873c4470cabf0dfcd310b21e818e0328 Mon Sep 17 00:00:00 2001 From: Anton Shvein aka T0ha Date: Wed, 23 Oct 2024 17:18:44 +0300 Subject: [PATCH] fix: deploy to stacks enabled --- .github/workflows/release-flask.yml | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release-flask.yml b/.github/workflows/release-flask.yml index 2d53f4b..5c9fe27 100644 --- a/.github/workflows/release-flask.yml +++ b/.github/workflows/release-flask.yml @@ -25,11 +25,15 @@ on: stacks-repo: type: string required: false - default: "git@github.com:coingaming/stacks.git" + default: "coingaming/stacks" stacks-name: type: string required: false default: ${{ inputs.app-name }} + stacks-branch-name: + type: string + required: false + default: ${{ inputs.app-name }} app-name: type: string required: true @@ -99,6 +103,9 @@ jobs: # with: # node-version: 20.10.0 + - name: Install yq + run: sudo apt-get install yq + - name: Add NPM Registry run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc @@ -107,8 +114,8 @@ jobs: GH_PAT: ${{ secrets.GH_TOKEN }} GIT_TERMINAL_PROMPT: 0 run: | - git config --global --replace-all url."https://${GH_PAT}@github.com/".insteadOf git@github.com: - git config --global --add url."https://${GH_PAT}@github.com/".insteadOf "https://github.com/" + git config --global user.email "actions@github.com" + git config --global user.name ${{ github.actor }} - name: Get & build for asset run: | @@ -138,13 +145,13 @@ jobs: --file ci.Dockerfile . docker push ${{ env.IMAGE }} - # - name: Deploy to stacks - # run: | - # git clone git@github.com:coingaming/${{ inputs.stacks-repo }} - # cd ${{ inputs.stacks-repo }} - # git checkout ${{ inputs.stacks-branch-name }} + - name: Deploy to stacks + run: | + git clone https://${{secrets.GH_TOKEN }}@github.com/${{ inputs.stacks-repo }}.git stacks + cd stacks + git checkout ${{ inputs.stacks-branch-name }} - # scripts/update-image ${{ inputs.stacks-name }} ${{inputs.service-name }} ${{ env.IMAGE }} + scripts/update-image ${{ inputs.stacks-name }} ${{inputs.service-name }} ${{ env.IMAGE }} - # git commit -am "upgraded ${{inputs.service-name }} service with ${{ env.IMMAGE }}" - # git push origin refs/heads/${{ inputs.stacks-branch-name }}:refs/heads/${{ inputs.stacks-branch-name }} + git commit -am "upgraded ${{inputs.service-name }} service with ${{ env.IMAGE }}" + git push origin refs/heads/${{ inputs.stacks-branch-name }}:refs/heads/${{ inputs.stacks-branch-name }}