Skip to content

Commit

Permalink
Merge pull request #26 from colinhacks/add-bun
Browse files Browse the repository at this point in the history
Support Bun package manager
  • Loading branch information
Princesseuh authored Aug 29, 2023
2 parents 6303cad + d2efda8 commit 8ab2579
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ For more information, please see our complete deployment guide—[Deploy your As

- `path` - Optional: the root location of your Astro project inside the repository.
- `node-version` - Optional: the specific version of Node that should be used to build your site. Defaults to `16`.
- `package-manager` - Optional: the Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile.
- `package-manager` - Optional: the Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. Accepted values: `npm`, `yarn`, `pnpm`, and `bun`.
- `resolve-dep-from-path` - Optional: If the dependency file should be resolved from the root location of your Astro project. Defaults to `true`.

### Example workflow:
Expand All @@ -28,10 +28,10 @@ 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 ]
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
Expand Down
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ runs:
elif [ $(find "." -name "package-lock.json") ]; then
echo "PACKAGE_MANAGER=npm" >> $GITHUB_ENV
echo "LOCKFILE=package-lock.json" >> $GITHUB_ENV
elif [ $(find "." -name "bun.lockb") ]; then
echo "PACKAGE_MANAGER=bun" >> $GITHUB_ENV
echo "LOCKFILE=bun.lockb" >> $GITHUB_ENV
else
echo "No lockfile found.
Please specify your preferred \"package-manager\" in the action configuration."
Expand All @@ -52,6 +55,12 @@ runs:
uses: pnpm/[email protected]
with:
version: 7.x.x

- name: Setup Bun
if: ${{ env.PACKAGE_MANAGER == 'bun' }}
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Setup Node
uses: actions/setup-node@v3
Expand Down

0 comments on commit 8ab2579

Please sign in to comment.