|
1 | 1 |
|
2 | | -name: Deploy to ping.pub |
| 2 | +name: Deploy to GitHub Pages |
3 | 3 |
|
4 | 4 | on: |
5 | 5 | push: |
6 | 6 | branches: [ main ] |
7 | | - # pull_request: |
8 | | - # branches: [ master ] |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + pages: write |
| 12 | + id-token: write |
| 13 | + |
| 14 | +concurrency: |
| 15 | + group: pages |
| 16 | + cancel-in-progress: false |
9 | 17 |
|
10 | 18 | jobs: |
| 19 | + build: |
| 20 | + name: Build site |
| 21 | + runs-on: ubuntu-latest |
| 22 | + steps: |
| 23 | + - name: Git Checkout Latest |
| 24 | + uses: actions/checkout@v4 |
| 25 | + with: |
| 26 | + submodules: recursive |
| 27 | + |
| 28 | + - name: Setup Pages |
| 29 | + uses: actions/configure-pages@v5 |
| 30 | + |
| 31 | + - name: Setup Node.js |
| 32 | + uses: actions/setup-node@v4 |
| 33 | + with: |
| 34 | + node-version: 18 |
| 35 | + cache: yarn |
| 36 | + cache-dependency-path: explorer/yarn.lock |
| 37 | + |
| 38 | + - name: Setup config |
| 39 | + run: cp -rf chains/* explorer/chains/ |
| 40 | + |
| 41 | + - name: Install dependencies |
| 42 | + working-directory: explorer |
| 43 | + run: yarn install --frozen-lockfile |
| 44 | + |
| 45 | + - name: Build |
| 46 | + working-directory: explorer |
| 47 | + run: yarn build |
| 48 | + env: |
| 49 | + NODE_OPTIONS: --max_old_space_size=4096 |
| 50 | + |
| 51 | + - name: Copy logos |
| 52 | + run: cp -rf logos explorer/dist/ |
| 53 | + |
| 54 | + - name: Upload Pages artifact |
| 55 | + uses: actions/upload-pages-artifact@v3 |
| 56 | + with: |
| 57 | + path: explorer/dist |
| 58 | + |
11 | 59 | deploy: |
12 | | - name: Ping deploy |
13 | | - runs-on: mainnet |
| 60 | + name: Deploy site |
| 61 | + needs: build |
| 62 | + runs-on: ubuntu-latest |
| 63 | + environment: |
| 64 | + name: github-pages |
| 65 | + url: ${{ steps.deployment.outputs.page_url }} |
14 | 66 | steps: |
15 | | - - name: Environment |
16 | | - run: export NODE_OPTIONS="--max_old_space_size=4096" |
17 | | - |
18 | | - - name: Clean Repository |
19 | | - run: rm -rf explorer |
20 | | - |
21 | | - - name: Git Checkout Latest |
22 | | - uses: actions/checkout@v4 |
23 | | - with: |
24 | | - submodules: recursive |
25 | | - |
26 | | - - name: Setup config |
27 | | - run: cp -rf chains/* explorer/chains/ |
28 | | - |
29 | | - - name: Build |
30 | | - run: cd explorer && yarn && yarn build |
31 | | - |
32 | | - - name: copy logos |
33 | | - run: cp -rf logos explorer/dist/ |
34 | | - |
35 | | - # - name: debug |
36 | | - # run: ls -l explorer/dist/logos |
37 | | - |
38 | | - - name: Deploy |
39 | | - run: cp -rf explorer/dist/* /var/www/html/ |
| 67 | + - name: Deploy to GitHub Pages |
| 68 | + id: deployment |
| 69 | + uses: actions/deploy-pages@v4 |
0 commit comments