Skip to content

update cli to 1.589.1 #90

update cli to 1.589.1

update cli to 1.589.1 #90

name: "Push main to Windmill workspace"
on:
workflow_dispatch:
push:
branches:
- "main"
# if the windmill workspace is persisted in a subfolder of this repos, you can add the following to avoid pushing to windmill when there's no change
# paths:
# - wm/**
env:
WMILL_URL: https://app.windmill.dev/
WMILL_WORKSPACE: github-sync-example-prod
jobs:
sync:
environment: windmill
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 20
# We check the commit to make sure it doesn't start with [WM] which commits coming from Windmill Git Sync do.\
# If that's the case, then we stop the workflow as we want to avoid overwriting changes that are out-of-sync
# (for instance if one were to deploy in quick succession)
- name: Check commit message
id: check_message
run: |
COMMIT_MESSAGE="${{ github.event.head_commit.message }}"
if [[ "$COMMIT_MESSAGE" =~ ^\[WM\] ]]; then
echo "Commit message starts with '[WM]', skipping push to Windmill to avoid overwriting deploy that immediately follows it"
echo "skip=skip" >> $GITHUB_OUTPUT
fi
# (push will pull first to detect conflicts and only push actual changes)
- name: Push changes
if: steps.check_message.outputs.skip != 'skip'
run: |
npm install -g [email protected]
wmill sync push --yes --skip-variables --skip-secrets --skip-resources --workspace ${{ env.WMILL_WORKSPACE }} --token ${{ secrets.WMILL_TOKEN }} --base-url ${{ env.WMILL_URL }}