Skip to content

Commit

Permalink
wip: add website workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
CMCDragonkai committed Jan 8, 2025
1 parent 4e97d2c commit 355c25e
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
104 changes: 104 additions & 0 deletions .github/workflows/application-js-cloudflare-feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: "CI / Application JS Cloudflare Feature"

on:
workflow_call:
secrets:
GH_TOKEN:
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

jobs:
# Lint the code
feature-lint:
name: "Feature / Lint"
runs-on: ubuntu-latest
container:
image: ghcr.io/matrixai/github-runner
permissions:
packages: read
contents: read
steps:
- uses: actions/checkout@v4
- 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
container:
image: ghcr.io/matrixai/github-runner
permissions:
packages: read
contents: read
actions: write
steps:
- uses: actions/checkout@v4
- 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
container:
image: ghcr.io/matrixai/github-runner
concurrency:
group: feature-deployment
cancel-in-progress: false
steps:
- run: entrypoint
- uses: actions/checkout@v4
with:
lfs: true
- uses: actions/download-artifact@v4
with:
name: public
path: ./public
- name: Run deployment
env:
name: "feature/${{ github.ref_name }}"
url: "https://${{ github.ref_name }}.dev.zeta.house"
GH_TOKEN: ${{ secrets.GH_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
ZETA_HOUSE_ENV: ${{ secrets.ZETA_HOUSE_ENV }}
ZETA_HOUSE_SUPABASE_URL: ${{ secrets.ZETA_HOUSE_SUPABASE_URL }}
ZETA_HOUSE_SUPABASE_KEY: ${{ secrets.ZETA_HOUSE_SUPABASE_KEY }}
ZETA_HOUSE_SENDGRID_API_KEY: ${{ secrets.ZETA_HOUSE_SENDGRID_API_KEY }}
ZETA_HOUSE_GOOGLE_MAPS_API_KEY: ${{ secrets.ZETA_HOUSE_GOOGLE_MAPS_API_KEY }}
run: |
echo 'Perform service deployment for feature'
nix develop .#ci --command bash -c $'
npm run deploy -- \
--feature "$GITHUB_REF_NAME" \
--env "$GITHUB_REF_NAME"
'
Empty file.
Empty file.

0 comments on commit 355c25e

Please sign in to comment.