withastro / action

A GitHub Action that deploys your Astro project to GitHub Pages
Other
143 stars 31 forks source link

need support for different pnpm versions #24

Closed reonokiy closed 10 months ago

reonokiy commented 1 year ago

I'm using pnpm v8.6.1 locally and the CI uses the v7 version of pnpm. The mismatch of versions will cause errors in CI.

The discussion https://github.com/orgs/pnpm/discussions/6633 describes the same issue.

Logs

2023-06-30T15:41:58.5412888Z env:
2023-06-30T15:41:58.5413087Z   INPUT_PM: pnpm
2023-06-30T15:41:58.5413283Z ##[endgroup]
2023-06-30T15:41:58.5651094Z ##[group]Run pnpm/action-setup@v2.2.2
2023-06-30T15:41:58.5651344Z with:
2023-06-30T15:41:58.5651530Z   version: 7.x.x
2023-06-30T15:41:58.5651735Z   dest: ~/setup-pnpm
2023-06-30T15:41:58.5651942Z   run_install: null
2023-06-30T15:41:58.5652117Z env:
2023-06-30T15:41:58.5652311Z   PACKAGE_MANAGER: pnpm
2023-06-30T15:41:58.5652518Z ##[endgroup]
2023-06-30T15:41:58.6814194Z ##[warning]The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2023-06-30T15:41:58.6855768Z ##[group]Running self-installer...
2023-06-30T15:41:59.2019803Z Progress: resolved 1, reused 0, downloaded 0, added 0
2023-06-30T15:41:59.2122840Z Packages: +1
2023-06-30T15:41:59.2123272Z +
2023-06-30T15:41:59.9078948Z Packages are hard linked from the content-addressable store to the virtual store.
2023-06-30T15:41:59.9079890Z   Content-addressable store is at: /home/runner/.pnpm-store/v3
2023-06-30T15:41:59.9080964Z   Virtual store is at:             node_modules/.pnpm
2023-06-30T15:41:59.9338720Z 
2023-06-30T15:41:59.9339435Z dependencies:
2023-06-30T15:41:59.9340277Z + pnpm 7.33.2 (8.6.5 is available)
2023-06-30T15:41:59.9341316Z 
2023-06-30T15:42:00.2034805Z Progress: resolved 1, reused 0, downloaded 1, added 1, done
2023-06-30T15:42:00.2158390Z ##[endgroup]
2023-06-30T15:42:00.2162206Z Installation Completed!
2023-06-30T15:42:00.2166092Z 
2023-06-30T15:42:00.2170961Z ##[warning]The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2023-06-30T15:42:00.2173245Z 
2023-06-30T15:42:00.2174927Z ##[warning]The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2023-06-30T15:42:00.2300941Z ##[group]Run actions/setup-node@v3
2023-06-30T15:42:00.2301166Z with:
2023-06-30T15:42:00.2301356Z   node-version: 18
2023-06-30T15:42:00.2301542Z   cache: pnpm
2023-06-30T15:42:00.2301763Z   cache-dependency-path: ./
2023-06-30T15:42:00.2301995Z   always-auth: false
2023-06-30T15:42:00.2302195Z   check-latest: false
2023-06-30T15:42:00.2302502Z   token: ***
2023-06-30T15:42:00.2302700Z env:
2023-06-30T15:42:00.2302883Z   PACKAGE_MANAGER: pnpm
2023-06-30T15:42:00.2303151Z   PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
2023-06-30T15:42:00.2303396Z ##[endgroup]
2023-06-30T15:42:00.4370664Z Found in cache @ /opt/hostedtoolcache/node/18.16.1/x64
2023-06-30T15:42:00.4382087Z ##[group]Environment details
2023-06-30T15:42:01.0826454Z node: v18.16.1
2023-06-30T15:42:01.0826898Z npm: 9.5.1
2023-06-30T15:42:01.0827164Z yarn: 1.22.19
2023-06-30T15:42:01.0836030Z ##[endgroup]
2023-06-30T15:42:01.0840333Z [command]/home/runner/setup-pnpm/node_modules/.bin/pnpm store path --silent
2023-06-30T15:42:01.6174066Z /home/runner/setup-pnpm/node_modules/.bin/store/v3
2023-06-30T15:42:03.0397299Z pnpm cache is not found
2023-06-30T15:42:03.0488434Z ##[group]Run cd .
2023-06-30T15:42:03.0488642Z cd .
2023-06-30T15:42:03.0488853Z $PACKAGE_MANAGER install
2023-06-30T15:42:03.0542055Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2023-06-30T15:42:03.0542307Z env:
2023-06-30T15:42:03.0542673Z   PACKAGE_MANAGER: pnpm
2023-06-30T15:42:03.0542948Z   PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
2023-06-30T15:42:03.0543188Z ##[endgroup]
2023-06-30T15:42:03.6418968Z  ERR_PNPM_LOCKFILE_CONFIG_MISMATCH  Cannot proceed with the frozen installation. The current "settings.autoInstallPeers" configuration doesn't match the value found in the lockfile
2023-06-30T15:42:03.6419635Z 
2023-06-30T15:42:03.6421292Z Update your lockfile using "pnpm install --no-frozen-lockfile"
2023-06-30T15:42:03.6621404Z ##[error]Process completed with exit code 1.

Github Actions Config

name: Deploy to GitHub Pages

on:
  # Trigger the workflow every time you push to the `main` branch
  # Using a different branch name? Replace `main` with your branch’s name
  push:
    branches: [ main ]
  # Allows you to run this workflow manually from the Actions tab on GitHub.
  workflow_dispatch:

# Allow this job to clone the repo and create a page deployment
permissions:
  contents: read
  pages: write
  id-token: write

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout your repository using git
        uses: actions/checkout@v3
      - name: Install, build, and upload your site
        uses: withastro/action@v0
        with:
            path: . # The root location of your Astro project inside the repository. (optional)
            node-version: 18 # The specific version of Node that should be used to build your site. Defaults to 16. (optional)
            package-manager: pnpm # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)

  deploy:
    needs: build
    runs-on: ubuntu-latest
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v1