ci: fix stuff with pnpm #34
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: Default | |
on: | |
push: | |
branches: ["**"] | |
pull_request: | |
env: | |
node-version: 18 | |
pnpm-version: 8 | |
jobs: | |
lint-styles: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.node-version }} | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: ${{ env.pnpm-version }} | |
- id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Lint styles | |
run: pnpm lint:styles | |
lint-scripts: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.node-version }} | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: ${{ env.pnpm-version }} | |
- id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Lint scripts | |
run: pnpm lint:scripts | |
lint-types: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.node-version }} | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: ${{ env.pnpm-version }} | |
- id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Lint types | |
run: pnpm lint:types | |
build: | |
needs: | |
- lint-styles | |
- lint-scripts | |
- lint-types | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.node-version }} | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: ${{ env.pnpm-version }} | |
- id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm build -m development --sourcemap | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: www | |
path: dist/ | |
retention-days: 1 | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
environment: preview | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: www | |
- name: Vercel | |
uses: amondnet/vercel-action@v25 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} | |
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} | |
alias-domains: | | |
{{BRANCH}}.muuvmuuv.vercel.app |