Deploy from alternative branches (#248)

* Try setting branch dynamically

* Just use the github_ref variable

* Some debug steps

* Why does git asteriks my output?

* Try env variable directly

* Use github context

* Remove the ref/head/ part from the branch name

* Set branch in env variable

* Try and fix env redirect

* Use/set correct env name
This commit is contained in:
Jonny Barnes 2022-01-16 15:45:16 +00:00 committed by GitHub
parent ee274d36b0
commit 3d1806e775
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,6 +21,12 @@ jobs:
- name: 🌎 Set Environment Variables Part 2
run: |
echo "newReleaseDir=${{ env.releasesDir }}/${{ env.newReleaseName }}" >> $GITHUB_ENV
- name: 🔀 Get Branch
id: branch
run: |
echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: 🔍 Check Branch
run: echo "${{ env.branch }}"
- name: 🔄 Clone Repository
uses: appleboy/ssh-action@master
with:
@ -39,7 +45,7 @@ jobs:
mkdir ${{ env.newReleaseDir }}
# Clone app
git clone --depth 1 --branch main https://github.com/${{ env.repository }} ${{ env.newReleaseName }}
git clone --depth 1 --branch ${{ env.branch }} https://github.com/${{ env.repository }} ${{ env.newReleaseName }}
# Mark release
cd ${{ env.newReleaseDir }}