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(ci): use garnix cache for deploy #586

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2191ea8
feat(explorer): wip
Swepool Aug 23, 2024
fa0ef6f
fix(explorer): remove configs and edit union
Swepool Aug 23, 2024
cf5a190
fix(explorer): update logo
Swepool Aug 23, 2024
325c1e9
fix(explorer): hide
Swepool Aug 23, 2024
093c360
fix(explorer): redirect to union
Swepool Aug 23, 2024
febfd9a
fix(app): favicon
Swepool Aug 23, 2024
61f7194
fix(explorer): add fonts
Swepool Aug 23, 2024
c6ddfd4
fix(explorer): clean up
Swepool Aug 26, 2024
48dc77d
fix(explorer): correct config
Swepool Aug 26, 2024
63b1edb
feat(explorer): save style progress
Swepool Aug 26, 2024
c8551ff
feat(explorer): save style progress
Swepool Aug 26, 2024
e90e98a
feat(explorer): nav style
Swepool Aug 26, 2024
8f23a5f
feat(explorer): save progress
Swepool Aug 26, 2024
4add235
feat(explorer): save style progress
Swepool Aug 26, 2024
ec5abf1
feat(explorer): save style progress
Swepool Aug 26, 2024
51a74de
feat(explorer): more styling
Swepool Aug 26, 2024
baf62a5
feat(explorer): add lint
Swepool Aug 26, 2024
7c40465
fix(explorer): lint
Swepool Aug 26, 2024
8042f4f
fix: daisy colors
o-az Aug 26, 2024
ea185a1
Merge pull request #1 from unionlabs/fix-daisy
o-az Aug 26, 2024
749cfb4
fix: unterminated string
PoisonPhang Aug 26, 2024
08b507d
fix: move chains
o-az Aug 26, 2024
dbe7c42
fix: chains path
o-az Aug 26, 2024
a63a5ee
fix(explorer): something broke after config changes
Swepool Aug 27, 2024
877cbfd
feat(explorer): add tooltip and twitter
Swepool Aug 27, 2024
3d56fe0
feat: nixify
PoisonPhang Aug 27, 2024
dbc1e88
feat(ci): deploy exlorer from main
PoisonPhang Aug 27, 2024
f8e8a12
fix(ci): deploy from master
PoisonPhang Aug 27, 2024
20e4f08
fix: remove unused deps and actually run the linter and formatter
o-az Aug 27, 2024
e4fb67b
chore: remove commented code
o-az Aug 27, 2024
fe04665
Merge pull request #3 from unionlabs/cleanup-fix
PoisonPhang Aug 28, 2024
65ec9a2
chore: update offline cache hash
PoisonPhang Aug 28, 2024
ab705ce
Merge pull request #4 from unionlabs/update-yarn-lock-hash
PoisonPhang Aug 28, 2024
1649a86
feat(nix): source filtering
PoisonPhang Aug 28, 2024
75986f5
feat(ci): use garnix cache instead of nixbuild
PoisonPhang Aug 28, 2024
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
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
use flake
export DIRENV_WARN_TIMEOUT=1m
5 changes: 0 additions & 5 deletions .github/FUNDING.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/config-check.yaml

This file was deleted.

115 changes: 115 additions & 0 deletions .github/workflows/deploy-explorer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Deploy Explorer

on:
push:
branches:
- master
pull_request:
workflow_dispatch:

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

env:
NODE_OPTIONS: '--no-warnings'

jobs:
garnix:
name: Wait on Garnix CI
runs-on: ubuntu-latest
steps:
- name: Wait on Garnix CI Check Suite
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
REF: ${{ github.head_ref }}
run: |
sleep 15

status=''

while [[ $status != 'completed' ]]; do
check_suites=$(gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/repos/$REPO/commits/$REF/check-suites")

status=$(echo "$check_suites" | jq -r '.check_suites | .[] | select(.app.name == "Garnix CI") | .status')
sleep 15
done

conclusion=$(echo "$check_suites" | jq -r '.check_suites | .[] | select(.app.name == "Garnix CI") | .conclusion')

case "$conclusion" in
failure | timed_out | action_required | stale | startup_failure)
echo "ERROR: Garnix CI concluded with $conclusion"
exit 1
;;
*)
echo "INFO: Garnix CI concluded with $conclusion"
;;
esac

deploy-preview:
runs-on: ['ubuntu-latest']
needs: [garnix]
permissions:
contents: read
pull-requests: write
env:
npm_config_yes: true
environment: 'app-preview'
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: nixbuild/nix-quick-install-action@v28
- name: Fetch from Cache
run: |
nix develop
nix build .#explorer
- 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="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-production:
runs-on: 'ubuntu-latest'
needs: [garnix]
env:
npm_config_yes: true
environment: 'explorer-production'
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: nixbuild/nix-quick-install-action@v28
- name: Fetch from Cache
run: |
nix develop
nix build .#explorer
- 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="explorer" --branch="main" deploy result
51 changes: 0 additions & 51 deletions .github/workflows/docker.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/mainnet-deploy.yaml.disabled

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/testnet-deploy.yaml

This file was deleted.

8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@ node_modules/
**/.vscode
yarn-error.log
dist
.idea
.idea
._*
_
result
.direnv
.eslintcache
.prettiercache
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable-pre-post-scripts = false
Loading
Loading