Skip to content

Commit

Permalink
ci: refactoring of deployment action
Browse files Browse the repository at this point in the history
  • Loading branch information
pure-js committed Sep 26, 2023
1 parent 209b120 commit b96a4e2
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 14 deletions.
38 changes: 31 additions & 7 deletions .github/workflows/deploy-to-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ on:
tags:
- '**'

workflow_dispatch:

concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
publish:
build:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -24,11 +30,29 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Deploy with gh-pages
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npm run deploy -- -u "github-actions-bot <[email protected]>"
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm run build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VITE_GROWTH_BOOK_KEY: ${{ secrets.VITE_GROWTH_BOOK_KEY }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'dist/'

deploy:
needs: build

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
8 changes: 4 additions & 4 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: Lighthouse CI

on: [push]

env:
VITE_GROWTH_BOOK_KEY: key_prod_b3021771bb20a0c2

jobs:
lighthouseci:
runs-on: ubuntu-latest
Expand All @@ -21,8 +18,11 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm i && pnpm install -g @lhci/[email protected]
- name: Install dependencies
run: pnpm install --frozen-lockfile && pnpm add -g @lhci/[email protected]
- run: pnpm run build
env:
VITE_GROWTH_BOOK_KEY: ${{ secrets.VITE_GROWTH_BOOK_KEY }}
- run: lhci autorun
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
run: pnpm install --frozen-lockfile
- name: Run ESLint
run: pnpm run lint
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
run: pnpm install --frozen-lockfile
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm test

0 comments on commit b96a4e2

Please sign in to comment.