File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,21 +28,24 @@ jobs:
2828
2929 - name : Add remote repo ${{ env.REPO }}
3030 run : |
31+ set -eux
3132 mkdir -p "$HOME/.ssh"
3233 echo "${{ secrets.SSH_DEPLOY_KEY }}" > "$HOME/.ssh/deploy_key"
3334 chmod 600 "$HOME/.ssh/deploy_key"
3435
3536 export GIT_SSH_COMMAND="ssh -i $HOME/.ssh/deploy_key"
3637 git remote add sync-repo git@github.com:${{ env.REPO }}.git
37- git fetch --all
38+ git fetch sync-repo deploy
3839
3940 - name : Fast-forward deployment branch
4041 run : |
41- git checkout -b deploy --track sync-repo/deploy
42+ set -eux
43+ git config push.default upstream
44+ git switch -c deploy sync-repo/deploy
45+ git branch -v
4246 git merge --ff-only ${{ env.RELEASE_CHANNEL }}
4347
4448 - name : Push to remote repo
4549 run : |
4650 export GIT_SSH_COMMAND="ssh -i $HOME/.ssh/deploy_key"
47- git config push.default upstream
4851 git push
Original file line number Diff line number Diff line change 88 workflow_dispatch :
99
1010env :
11- RELEASE_CHANNEL : prod
11+ RELEASE_CHANNEL : staging
1212 REPO : ${{ vars.REPO }}
1313
1414defaults :
2828
2929 - name : Add remote repo ${{ env.REPO }}
3030 run : |
31+ set -eux
3132 mkdir -p "$HOME/.ssh"
3233 echo "${{ secrets.SSH_DEPLOY_KEY }}" > "$HOME/.ssh/deploy_key"
3334 chmod 600 "$HOME/.ssh/deploy_key"
3839
3940 - name : Fast-forward deployment branch
4041 run : |
42+ set -eux
4143 git config push.default upstream
4244 git switch -c deploy sync-repo/deploy
45+ git branch -v
4346 git merge --ff-only ${{ env.RELEASE_CHANNEL }}
4447
4548 - name : Push to remote repo
You can’t perform that action at this time.
0 commit comments