Merge pull request #4 from unionlabs/update-yarn-lock-hash #3
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 Explorer | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
env: | |
NODE_OPTIONS: '--no-warnings' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- uses: nixbuild/nix-quick-install-action@v26 | |
with: | |
nix_on_tmpfs: false | |
nix_conf: | | |
experimental-features = nix-command flakes | |
access-tokens = ${{ secrets.GITHUB_TOKEN }} | |
- uses: nixbuild/nixbuild-action@812f1ab2b51842b0d44b9b79574611502d6940a0 | |
with: | |
nixbuild_token: ${{secrets.NIXBUILD_TOKEN}} | |
- name: Build explorer | |
run: | | |
touch build.json | |
nix build .#packages.x86_64-linux.explorer \ | |
--print-build-logs \ | |
--eval-store auto \ | |
--store ssh-ng://eu.nixbuild.net \ | |
--builders "" --max-jobs 2 \ | |
--show-trace \ | |
--json | |
deploy-production: | |
runs-on: 'ubuntu-latest' | |
needs: [ build ] | |
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@v26 | |
- uses: nixbuild/nixbuild-action@812f1ab2b51842b0d44b9b79574611502d6940a0 | |
with: | |
nixbuild_token: ${{ secrets.NIXBUILD_TOKEN }} | |
- run: mkdir dump | |
- run: nix copy --to file://`pwd`/dump --from ssh-ng://eu.nixbuild.net `nix eval --raw .#packages.x86_64-linux.explorer` --extra-experimental-features nix-command | |
- run: cat dump/nar/*.nar.xz | xz -dc | nix-store --restore result | |
- 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 |