Skip to content

Commit

Permalink
add smart deploy functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
neonspectra committed Nov 16, 2023
1 parent 5139112 commit 1f98231
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/arise-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

0 comments on commit 1f98231

Please sign in to comment.