Skip to content

Commit

Permalink
Merge pull request #1985 from OctopusDeploy/sf/migrate-to-pnpm
Browse files Browse the repository at this point in the history
Migrate to PNPM and update Astro
  • Loading branch information
steve-fenton-octopus authored Aug 31, 2023
2 parents f25861d + bc0a5e0 commit 8b17fb6
Show file tree
Hide file tree
Showing 307 changed files with 5,128 additions and 12,859 deletions.
29 changes: 23 additions & 6 deletions .github/workflows/build-astro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
push:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab on GitHub.

# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
Expand All @@ -32,20 +30,39 @@ jobs:
with:
node-version: 18

- name: NPM and Playwright install
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.7.0
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: PNPM and Playwright install
run: |
echo; echo "cd to workspace"
cd $GITHUB_WORKSPACE
echo; echo "listing"
ls
echo; echo "NPM install"
npm ci
npx playwright install --with-deps
pnpm install
- name: Astro build and test
run: |
export NODE_OPTIONS=--max_old_space_size=4096
npm run test
pnpm img
pnpm test
- name: Set Version
run: |
Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Expose Astro dependencies for `pnpm` users
shamefully-hoist=true
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ See the [Octopus style guide](https://style.octopus.com) for information includi
Before merging to `main` it's possible you'd like to see your changes in a preview environment. It's simple to do this:

1. You need [Node.js](https://nodejs.org/en) installed to run the site locally
2. Run `npm install` to obtain the dependencies
3. Run `npm run dev` to run a local preview of the site
2. Run `pnpm install` to obtain the dependencies
3. Run `pnpm dev` to run a local preview of the site
4. Open `localhost:3000` to view the site, the first page load usually takes a little time

You can generate a static copy of the site using `pnpm build` and run it in a browser with `pnpm preview`.
3 changes: 3 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ export default defineConfig({
trailingSlash: 'never',
extendDefaultPlugins: true,
},
server: {
port: 3000
},
});
Loading

0 comments on commit 8b17fb6

Please sign in to comment.