Skip to content

Commit 51bc8d1

Browse files
committed
Continue troubleshooting branch checkout...
1 parent 3f4ac4c commit 51bc8d1

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/sync-repo-prod.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff 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

.github/workflows/sync-repo-staging.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99

1010
env:
11-
RELEASE_CHANNEL: prod
11+
RELEASE_CHANNEL: staging
1212
REPO: ${{ vars.REPO }}
1313

1414
defaults:
@@ -28,6 +28,7 @@ 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"
@@ -38,8 +39,10 @@ jobs:
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

0 commit comments

Comments
 (0)