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:
parent
ee274d36b0
commit
3d1806e775
1 changed files with 7 additions and 1 deletions
8
.github/workflows/deploy.yml
vendored
8
.github/workflows/deploy.yml
vendored
|
@ -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 }}
|
||||
|
|
Loading…
Add table
Reference in a new issue