diff --git a/.github/workflows/arise-deploy.yml b/.github/workflows/arise-deploy.yml index f455e41..7461af2 100644 --- a/.github/workflows/arise-deploy.yml +++ b/.github/workflows/arise-deploy.yml @@ -21,6 +21,18 @@ jobs: runs-on: ubuntu-latest name: Deploy Arise steps: + - name: Check if we should push to main or debug + run: | + if [[ $GITHUB_REF == 'refs/heads/main' ]]; then + echo "OUTPUT_BRANCH=html" >> "$GITHUB_ENV" # Feel free to change the value of OUTPUT_BRANCH. This is where Arise artefacts will be pushed for production. + echo "Workflow running from main branch. Pushing results to production deployment branch (html)." + elif [[ "${{ github.event_name }}" == "schedule" ]]; then + gh run cancel "${{ github.run_id }}" + else + echo "OUTPUT_BRANCH=html-staging" >> "$GITHUB_ENV" # Feel free to change the value of OUTPUT_BRANCH. This is where Arise artefacts will be pushed for staging. + echo "Workflow running from a development branch. Pushing results to staging deployment branch (html-staging)." + fi + - name: git-checkout uses: actions/checkout@v4 @@ -34,7 +46,7 @@ jobs: uses: s0/git-publish-subdir-action@develop env: REPO: self - BRANCH: html-staging # Feel free to change this. This is where Arise artefacts will be pushed. + BRANCH: {{ env.OUTPUT_BRANCH }} # If you want to change this, change it in the step above. This allows us to intelligently deploy to production from main or staging if we're on a dev branch. FOLDER: arise-out # The Arise build output location. Don't change this. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Handled automatically -- Don't change this unless you're pushing to a different repo MESSAGE: "Commit: ({sha}) {msg}" # Copies commit msg from main to the deploy version branch