Skip to content
name: "CI / Application JS Cloudflare Feature"
on:
workflow_call:
inputs:
DEPLOY_SECRETS:
required: true
type: string
secrets:
GH_TOKEN:
required: true
NIXPKGS_PRIVATE_PAT:
required: true
# CLOUDFLARE_ACCOUNT_ID:
# required: true
# CLOUDFLARE_ZONE_ID:
# required: true
# CLOUDFLARE_API_TOKEN:
# required: true
# ZETA_HOUSE_ENV:
# required: true
# ZETA_HOUSE_SUPABASE_URL:
# required: true
# ZETA_HOUSE_SUPABASE_KEY:
# required: true
# ZETA_HOUSE_SENDGRID_API_KEY:
# required: true
# ZETA_HOUSE_GOOGLE_MAPS_API_KEY:
# required: true
env:
NIX_CONFIG: access-tokens = github.com=${{ secrets.NIXPKGS_PRIVATE_PAT }}
jobs:
# Lint the code
feature-lint:
name: "Feature / Lint"
runs-on: ubuntu-latest
permissions:
packages: read
contents: read
steps:
- uses: actions/checkout@v4
- uses: MatrixAI/.github/.github/actions/install-nix
- name: Run linting
run: |
nix develop .#ci --command bash -c $'
npm run lint
'
# Build the public
feature-build:
name: "Feature / Build"
runs-on: ubuntu-latest
permissions:
packages: read
contents: read
actions: write
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: MatrixAI/.github/.github/actions/install-nix
- name: Run build
run: |
nix develop .#ci --command bash -c $'
npm run build --verbose
'
- name: Upload Build
uses: actions/upload-artifact@v4
with:
name: public
path: ./public
# Deploy the public
feature-deployment:
name: "Feature / Deployment"
runs-on: ubuntu-latest
needs: feature-build
concurrency:
group: feature-deployment
cancel-in-progress: false
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: MatrixAI/.github/.github/actions/install-nix
- uses: actions/download-artifact@v4
with:
name: public
path: ./public
- name: Setup Deploy Secrets
run: |
echo "${{ inputs.DEPLOY_SECRETS }}" | jq -r 'to_entries | .[] | "\(.key)=\(.value)"' >> $GITHUB_ENV
- name: Run deployment
env:
name: "feature/${{ github.ref_name }}"
url: "https://${{ github.ref_name }}.dev.zeta.house"
run: |
echo 'Perform service deployment for feature'
echo "$SECRET1"
echo "$SECRET2"
echo "$SECRET3"
nix develop .#ci --command bash -c $'
npm run deploy -- \
--feature "$GITHUB_REF_NAME" \
--env "$GITHUB_REF_NAME"
'