From ac7d0cdc1457e8ca980dc36d5676df7e8aa1f2aa Mon Sep 17 00:00:00 2001 From: iBug Date: Sat, 21 Nov 2020 15:27:19 +0800 Subject: [PATCH 1/2] GH Actions: Push current ref to deploy branch after test success This relieves some pressure and dependency on MS, where we both [update the deploy branch] and [notify Smokey of updates]. Previously during MS downtime we had to update the deploy branch manually, moving this to CI creates a CD-like service that is supposed to be more automated and reliable. --- .github/workflows/build.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 071367c880..f2216ced06 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,3 +55,16 @@ jobs: --cov=chatcommands \ --cov=helpers \ test + + release: + if: ${{ github.ref == 'master' }} + needs: build + steps: + - uses: actions/checkout@v2 + - name: Fetch branches + run: | + git remote set-branches --add origin deploy + git fetch --all --depth=5 + - name: Push to deploy + run: | + git push origin +HEAD:deploy From 9503fe0195fd78de0d5ae542197bb0cb95a3eb18 Mon Sep 17 00:00:00 2001 From: iBug Date: Sat, 21 Nov 2020 16:36:38 +0800 Subject: [PATCH 2/2] Don't force-push, allow failure --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f2216ced06..6d93265a62 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,5 +66,6 @@ jobs: git remote set-branches --add origin deploy git fetch --all --depth=5 - name: Push to deploy + continue-on-error: true run: | - git push origin +HEAD:deploy + git push origin HEAD:deploy