feat: new transfer flow #1579
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy App | |
on: | |
push: | |
branches: | |
- main | |
- release/app | |
paths: | |
- 'app/**' | |
pull_request: | |
paths: | |
- 'app/**' | |
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 | |
jobs: | |
deploy-preview: | |
runs-on: ['ubuntu-latest'] | |
permissions: | |
contents: read | |
pull-requests: write | |
env: | |
npm_config_yes: true | |
ENVIRONMENT: 'preview' | |
environment: 'app-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 | |
env: | |
ENVIRONMENT: ${{ env.ENVIRONMENT }} | |
run: | | |
nix build .#app | |
- 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="app" deploy result >> /tmp/app_deploy.txt | |
- name: Set Deploy Output | |
run: | | |
{ | |
echo 'DEPLOY_OUTPUT<<EOF' | |
tail -n 2 /tmp/app_deploy.txt | |
echo 'EOF' | |
} >> $GITHUB_ENV | |
- name: Comment Site Deploy Results | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: | | |
# App 🤌 | |
${{ env.DEPLOY_OUTPUT }} | |
**${{ env.LAST_UPDATED_AT }}** | |
comment_tag: deploy-app-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: 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 | |
env: | |
ENVIRONMENT: ${{ env.ENVIRONMENT }} | |
run: | | |
nix build .#app | |
- 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="app" deploy result | |
deploy-staging: | |
runs-on: ['ubuntu-latest'] | |
env: | |
npm_config_yes: true | |
ENVIRONMENT: 'staging' | |
environment: 'app-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 | |
env: | |
ENVIRONMENT: ${{ env.ENVIRONMENT }} | |
run: | | |
nix build .#app | |
- 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="app" --branch="staging" deploy result | |
deploy-production: | |
runs-on: ['ubuntu-latest'] | |
env: | |
npm_config_yes: true | |
ENVIRONMENT: 'production' | |
environment: 'app-production' | |
if: github.event_name == 'push' && github.ref == 'refs/heads/release/app' | |
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 | |
env: | |
ENVIRONMENT: ${{ env.ENVIRONMENT }} | |
run: | | |
nix build .#app | |
- 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="app" --branch="main" deploy result |