|
| 1 | +name: Release ledger.ternent.dev |
| 2 | +env: |
| 3 | + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} |
| 4 | + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_LEDGER_PROJECT_ID }} |
| 5 | + PNPM_CACHE_PATH: ~/.pnpm-store |
| 6 | + PNPM_CACHE_NAME: pnpm-store-cache |
| 7 | + SEAL_IDENTITY: ${{ secrets.SEAL_IDENTITY }} |
| 8 | +on: |
| 9 | + push: |
| 10 | + tags: |
| 11 | + - "ledger-*.*.*" |
| 12 | + |
| 13 | +jobs: |
| 14 | + Deploy-Production: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - name: Checkout repo |
| 18 | + uses: actions/checkout@master |
| 19 | + with: |
| 20 | + fetch-depth: 0 |
| 21 | + persist-credentials: false |
| 22 | + |
| 23 | + - name: Get branch name |
| 24 | + id: branch |
| 25 | + run: | |
| 26 | + echo "branch_name=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV |
| 27 | +
|
| 28 | + - name: Get node version |
| 29 | + id: nvmrc |
| 30 | + run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) |
| 31 | + |
| 32 | + - name: Setup PNPM |
| 33 | + uses: pnpm/action-setup@v2 |
| 34 | + with: |
| 35 | + version: 8 |
| 36 | + |
| 37 | + - name: Install Vercel CLI |
| 38 | + run: pnpm install --global vercel@latest |
| 39 | + |
| 40 | + - name: Install dependencies |
| 41 | + run: pnpm install --frozen-lockfile |
| 42 | + |
| 43 | + - name: Build dependencies |
| 44 | + run: pnpm --filter ternent-utils --filter ternent-ui --filter ternent-identity --filter @ternent/identity --filter @ternent/rage --filter @ternent/armour --filter @ternent/seal-cli --filter @ternent/concord-protocol build |
| 45 | + |
| 46 | + - name: Build ledger app |
| 47 | + run: pnpm --filter ledger build |
| 48 | + |
| 49 | + - name: Link Vercel project |
| 50 | + run: vercel link --yes --cwd ${{ github.workspace }}/apps/ledger --token=${{ secrets.VERCEL_TOKEN }} |
| 51 | + |
| 52 | + - name: Pull Vercel Environment Information |
| 53 | + run: vercel pull --yes --environment=production --cwd ${{ github.workspace }}/apps/ledger --token=${{ secrets.VERCEL_TOKEN }} |
| 54 | + |
| 55 | + - name: Build Vercel Environment Information |
| 56 | + run: vercel build --prod --cwd ${{ github.workspace }}/apps/ledger --token=${{ secrets.VERCEL_TOKEN }} |
| 57 | + |
| 58 | + - name: Generate sealed site artifacts |
| 59 | + uses: samternent/seal-action@v2 |
| 60 | + with: |
| 61 | + assets-directory: apps/ledger/.vercel/output/static |
| 62 | + |
| 63 | + - name: Deploy Project Artifacts to Vercel |
| 64 | + run: vercel deploy --prebuilt --prod --cwd ${{ github.workspace }}/apps/ledger --token=${{ secrets.VERCEL_TOKEN }} |
0 commit comments