-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (43 loc) · 1.38 KB
/
deploy.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
47
48
49
name: Deploy to Juno
on:
push:
branches: [main]
jobs:
check_run_conditions:
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.check_template.outputs.should_run }}
steps:
- name: Check if repo is template
id: check_template
run: |
IS_TEMPLATE=$(curl -s -H "Authorization: token ${{ github.token }}" \
"https://api.github.com/repos/${{ github.repository }}" | \
jq -r .is_template)
if [ "$IS_TEMPLATE" = "true" ]; then
echo "should_run=false" >> $GITHUB_OUTPUT
else
echo "should_run=true" >> $GITHUB_OUTPUT
fi
- name: Print should_run
run: |
echo "should_run: ${{ steps.check_template.outputs.should_run }}"
build:
needs: check_run_conditions
if: needs.check_run_conditions.outputs.should_run == 'true'
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Setup NodeJS
uses: ./.github/actions/setup-node
- name: Build
run: pnpm build
- name: Deploy to Juno
uses: junobuild/juno-action@main
with:
args: deploy
env:
JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}
SANITY_STUDIO_PROJECT_ID: ${{ vars.SANITY_STUDIO_PROJECT_ID }}
SANITY_STUDIO_DATASET: ${{ vars.SANITY_STUDIO_DATASET }}