-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (39 loc) · 1.57 KB
/
push-on-merge.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: "Push main to windmill workspace"
on:
workflow_dispatch:
push:
branches:
- "main"
# schedule:
# - cron: '0 * * * *'
env:
WM_HOST: https://app.windmill.dev/
DEV_WORKSPACE: dev-sync-example
STAGING_WORKSPACE: staging-sync-example
PROD_WORKSPACE: prod-sync-example
CLI_URL: https://deno.land/x/[email protected]/main.ts
jobs:
sync:
environment: windmill
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x
# (push will pull first to detect conflicts and only push actual changes)
- name: Push changes
run: |
cd dev
deno run --unstable -A ${{ env.CLI_URL }} workspace add dev ${{ env.DEV_WORKSPACE }} ${{ env.WM_HOST }} --token ${{ secrets.WMILL_TOKEN }}
deno run --unstable -A ${{ env.CLI_URL }} sync push --yes --fail-conflicts
cd ../staging
deno run --unstable -A ${{ env.CLI_URL }} workspace add staging ${{ env.STAGING_WORKSPACE }} ${{ env.WM_HOST }} --token ${{ secrets.WMILL_TOKEN }}
deno run --unstable -A ${{ env.CLI_URL }} sync push --yes --fail-conflicts
cd ../prod
deno run --unstable -A ${{ env.CLI_URL }} workspace add prod ${{ env.PROD_WORKSPACE }} ${{ env.WM_HOST }} --token ${{ secrets.WMILL_TOKEN }}
deno run --unstable -A ${{ env.CLI_URL }} sync push --yes --fail-conflicts
# autocommit the new .wmill state after the push
- uses: stefanzweifel/git-auto-commit-action@v4