Skip to content

fix: deploy only if not template and load config from env #2

fix: deploy only if not template and load config from env

fix: deploy only if not template and load config from env #2

Workflow file for this run

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
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
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
- name: Install dependencies
shell: bash
run: pnpm i --frozen-lockfile
- name: Build
run: npm run build
- name: Deploy to Juno
uses: junobuild/juno-action@main
with:
args: deploy
env:
JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}