Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(zkgm-dev): scaffold #3343

Merged
merged 5 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 139 additions & 0 deletions .github/workflows/deploy-zkgm-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: Deploy Zkgm-dev

on:
push:
branches:
- main
- release/zkgm-dev
paths:
- 'zkgm-dev/**'
pull_request:
paths:
- 'zkgm-dev/**'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

env:
NODE_OPTIONS: '--no-warnings'
ACTIONS_RUNNER_DEBUG: true
ASTRO_TELEMETRY_DISABLED: true

jobs:
deploy-preview:
runs-on: ['ubuntu-latest']
permissions:
contents: read
pull-requests: write
env:
npm_config_yes: true
environment: 'zkgm-dev-preview'
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: nixbuild/nix-quick-install-action@v28
with:
nix_conf: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= union.cachix.org-1:TV9o8jexzNVbM1VNBOq9fu8NK+hL6ZhOyOh0quATy+M=
trusted-substituters = https://cache.nixos.org https://cache.garnix.io https://union.cachix.org
- name: Fetch from Cache
run: |
nix build .#zkgm-dev
- name: '[preview] 🔶 Publish to Cloudflare Pages'
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }}
run: npx --yes wrangler@latest pages --project-name="zkgm-dev" deploy result >> /tmp/zkgm-dev_deploy.txt

- name: Set Deploy Output
run: |
{
echo 'DEPLOY_OUTPUT<<EOF'
tail -n 2 /tmp/zkgm-dev_deploy.txt
echo 'EOF'
} >> $GITHUB_ENV

- name: Comment Site Deploy Results
uses: thollander/actions-comment-pull-request@v2
with:
message: |
# zkgm.dev 🦀
${{ env.DEPLOY_OUTPUT }}

**${{ env.LAST_UPDATED_AT }}**
comment_tag: deploy-zkgm-dev-preview-result

deploy-manual:
runs-on: ['ubuntu-latest']
env:
npm_config_yes: true
if: github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: nixbuild/nix-quick-install-action@v28
with:
nix_conf: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= union.cachix.org-1:TV9o8jexzNVbM1VNBOq9fu8NK+hL6ZhOyOh0quATy+M=
trusted-substituters = https://cache.nixos.org https://cache.garnix.io https://union.cachix.org
- name: Fetch from Cache
run: |
nix build .#zkgm-dev
- name: '[workflow-dispatch] 🔶 Publish to Cloudflare Pages'
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }}
run: npx --yes wrangler@latest pages --project-name="zkgm-dev" deploy result

deploy-staging:
runs-on: ['ubuntu-latest']
env:
npm_config_yes: true
environment: 'zkgm-dev-staging'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: nixbuild/nix-quick-install-action@v28
with:
nix_conf: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= union.cachix.org-1:TV9o8jexzNVbM1VNBOq9fu8NK+hL6ZhOyOh0quATy+M=
trusted-substituters = https://cache.nixos.org https://cache.garnix.io https://union.cachix.org
- name: Fetch from Cache
run: |
nix build .#zkgm-dev
- name: '[staging] 🔶 Publish to Cloudflare Pages'
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }}
run: npx --yes wrangler@latest pages --project-name="zkgm-dev" --branch="staging" deploy result

deploy-production:
runs-on: ['ubuntu-latest']
env:
npm_config_yes: true
environment: 'zkgm-dev-production'
if: github.event_name == 'push' && github.ref == 'refs/heads/release/zkgm-dev'
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: nixbuild/nix-quick-install-action@v28
with:
nix_conf: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= union.cachix.org-1:TV9o8jexzNVbM1VNBOq9fu8NK+hL6ZhOyOh0quATy+M=
trusted-substituters = https://cache.nixos.org https://cache.garnix.io https://union.cachix.org
- name: Fetch from Cache
run: |
nix build .#zkgm-dev
- name: '[production] 🔶 Publish to Cloudflare Pages'
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }}
run: npx --yes wrangler@latest pages --project-name="zkgm-dev" --branch="main" deploy result
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@
./e2e/e2e.nix
./devnet-compose/devnet-compose.nix
./drip/drip.nix
./zkgm-dev/zkgm-dev.nix
treefmt-nix.flakeModule
];

Expand Down
23 changes: 23 additions & 0 deletions zkgm-dev/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
node_modules

# Output
.output
.vercel
.netlify
.wrangler
/.svelte-kit
/build

# OS
.DS_Store
Thumbs.db

# Env
.env
.env.*
!.env.example
!.env.test

# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
1 change: 1 addition & 0 deletions zkgm-dev/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
1 change: 1 addition & 0 deletions zkgm-dev/README.md
cor marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# zkgm.dev website
Loading
Loading