Skip to content
Open
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
155 changes: 155 additions & 0 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: Deploy Site

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

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

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

jobs:
deploy-preview:
runs-on: ['ubuntu-latest']
permissions:
contents: read
pull-requests: write
env:
npm_config_yes: true
ENVIRONMENT: 'preview'
environment: 'site-preview'
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
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
env:
ENVIRONMENT: ${{ env.ENVIRONMENT }}
run: |
nix build .#site
- name: '[preview] 🔶 Publish to Cloudflare Pages'
env:
ENVIRONMENT: ${{ env.ENVIRONMENT }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }}
run: npx --yes wrangler@latest pages --project-name="site" deploy result >> /tmp/site_deploy.txt

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

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

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

deploy-manual:
runs-on: ['ubuntu-latest']
env:
npm_config_yes: true
ENVIRONMENT: 'preview'
if: github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
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
env:
ENVIRONMENT: ${{ env.ENVIRONMENT }}
run: |
nix build .#site
- name: '[workflow-dispatch] 🔶 Publish to Cloudflare Pages'
env:
ENVIRONMENT: ${{ env.ENVIRONMENT }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }}
run: npx --yes wrangler@latest pages --project-name="site" deploy result

deploy-staging:
runs-on: ['ubuntu-latest']
env:
npm_config_yes: true
ENVIRONMENT: 'staging'
environment: 'site-staging'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
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
env:
ENVIRONMENT: ${{ env.ENVIRONMENT }}
run: |
nix build .#site
- name: '[staging] 🔶 Publish to Cloudflare Pages'
env:
ENVIRONMENT: ${{ env.ENVIRONMENT }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }}
run: npx --yes wrangler@latest pages --project-name="site" --branch="staging" deploy result

deploy-production:
runs-on: ['ubuntu-latest']
env:
npm_config_yes: true
ENVIRONMENT: 'production'
environment: 'site-production'
if: github.event_name == 'push' && github.ref == 'refs/heads/release/site'
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
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
env:
ENVIRONMENT: ${{ env.ENVIRONMENT }}
run: |
nix build .#site
- name: '[production] 🔶 Publish to Cloudflare Pages'
env:
ENVIRONMENT: ${{ env.ENVIRONMENT }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }}
run: npx --yes wrangler@latest pages --project-name="site" --branch="main" deploy result

12 changes: 6 additions & 6 deletions garnix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ builds:
- 'checks.aarch64-linux.nil'
- 'checks.aarch64-linux.ssz-tests-up-to-date'
- 'checks.*.all-crates-buildable-individually'
- 'checks.*.e2e-lst'
- 'checks.*.devnet-eth-runs'
- 'checks.*.e2e-lst'
- 'checks.*.ensure-blocks'
- 'checks.*.epoch-completes'
- 'checks.*.forced-set-rotation'
Expand All @@ -34,6 +34,7 @@ builds:
- 'packages.aarch64-linux.generate-ssz-compliance-tests'
- 'packages.aarch64-linux.sentinel2'
- 'packages.aarch64-linux.show-solidity-coverage'
- 'packages.aarch64-linux.site'
- 'packages.aarch64-linux.solidity-coverage'
- 'packages.*.cosmwasm-scripts'
- 'packages.*.devnet-osmosis-home'
Expand All @@ -57,14 +58,13 @@ builds:
- 'packages.*.go-vendor'
- 'packages.*.hubble-abis'
- 'packages.*.ignite-cli'
- 'packages.*.rust-docs'
- 'packages.*.rust-sol-bindings'
- 'packages.*.site'
- 'packages.*.uniond-release'
- 'packages.*.uniond-release-image'
- 'packages.*.voyager'
- 'packages.*.voyager-modules'
- 'packages.*.voyager-modules-plugins-names'
- 'packages.*.rust-docs'
branch: main
# build x86_64 on all branches
- include:
Expand All @@ -74,8 +74,8 @@ builds:
- 'nixosConfigurations.*'
exclude:
- 'checks.*.all-crates-buildable-individually'
- 'checks.*.e2e-lst'
- 'checks.*.devnet-eth-runs'
- 'checks.*.e2e-lst'
- 'checks.*.ensure-blocks'
- 'checks.*.epoch-completes'
- 'checks.*.forced-set-rotation'
Expand All @@ -85,6 +85,7 @@ builds:
- 'checks.*.upgrade-from-genesis'
- 'checks.*.upgrade-with-tokenfactory-state'
- 'checks.*.virtualisation-works'
- 'packages.aarch64-linux.site'
- 'packages.*.cosmwasm-scripts'
- 'packages.*.devnet-osmosis-home'
- 'packages.*.devnet-simd-home'
Expand All @@ -107,12 +108,11 @@ builds:
- 'packages.*.go-vendor'
- 'packages.*.hubble-abis'
- 'packages.*.ignite-cli'
- 'packages.*.rust-docs'
- 'packages.*.rust-sol-bindings'
- 'packages.*.site'
- 'packages.*.uniond-release'
- 'packages.*.uniond-release-image'
- 'packages.*.voyager'
- 'packages.*.voyager-modules'
- 'packages.*.voyager-modules-plugins-names'
- 'packages.*.rust-docs'
enableGithubOrgAccessTokens: true
Loading
Loading