|
| 1 | +name: 🚀 UI deployment |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ["main"] |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +# Allows only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 9 | +# However, we do not cancel in-progress runs as we want to allow these production deployments to complete. |
| 10 | +concurrency: |
| 11 | + group: "pages" |
| 12 | + cancel-in-progress: false |
| 13 | + |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + runs-on: ${{ matrix.os }} |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + os: |
| 20 | + - ubuntu-latest |
| 21 | + node_version: |
| 22 | + - 20 |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Checkout |
| 26 | + uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - name: Install pnpm |
| 29 | + uses: pnpm/action-setup@v2 |
| 30 | + with: |
| 31 | + version: latest |
| 32 | + run_install: false |
| 33 | + |
| 34 | + - name: Get pnpm cache directory path |
| 35 | + id: pnpm-cache-dir-path |
| 36 | + run: echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT |
| 37 | + |
| 38 | + - name: Restore pnpm cache |
| 39 | + uses: actions/cache@v3 |
| 40 | + id: pnpm-cache |
| 41 | + with: |
| 42 | + path: | |
| 43 | + ${{ steps.pnpm-cache-dir-path.outputs.dir }} |
| 44 | + ${{ github.workspace }}/interface/.next/cache |
| 45 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('interface/**/*.js', 'interface/**/*.jsx', 'interface/**/*.ts', 'interface/**/*.tsx') }} |
| 46 | + restore-keys: | |
| 47 | + ${{ runner.os }}-pnpm-store- |
| 48 | +
|
| 49 | + - name: Use Node.js ${{ matrix.node_version }} |
| 50 | + uses: actions/setup-node@v4 |
| 51 | + with: |
| 52 | + node-version: ${{ matrix.node_version }} |
| 53 | + |
| 54 | + - name: Install pnpm project with a clean slate |
| 55 | + run: pnpm install --prefer-offline --frozen-lockfile |
| 56 | + |
| 57 | + - name: Build with Next.js |
| 58 | + run: pnpm build:interface |
| 59 | + |
| 60 | + - name: Upload artifacts |
| 61 | + uses: actions/upload-pages-artifact@v2 |
| 62 | + with: |
| 63 | + path: "interface/dist" |
| 64 | + |
| 65 | + deploy: |
| 66 | + runs-on: ${{ matrix.os }} |
| 67 | + needs: build |
| 68 | + environment: |
| 69 | + name: github-pages |
| 70 | + url: ${{ steps.deployment.outputs.page_url }} |
| 71 | + permissions: |
| 72 | + pages: write |
| 73 | + id-token: write |
| 74 | + strategy: |
| 75 | + matrix: |
| 76 | + os: |
| 77 | + - ubuntu-latest |
| 78 | + |
| 79 | + steps: |
| 80 | + - name: Deploy to GitHub Pages |
| 81 | + id: deployment |
| 82 | + uses: actions/deploy-pages@v3 |
0 commit comments