Skip to content

Commit

Permalink
[chore] github action for build
Browse files Browse the repository at this point in the history
  • Loading branch information
ashbuilds committed Jul 24, 2024
1 parent 8d0c0b4 commit a186b03
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build Plugin

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # Adjust this to match your project's Node.js version

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8 # Adjust this to match your pnpm version

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
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

- name: Commit and push if changed
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git diff --quiet && git diff --staged --quiet || (git commit -m "Automated build" && git push)
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "payload-ai",
"version": "1.0.0",
"private": false,
"bugs": "https://github.com/ashbuilds/payload-plugins/issues",
"repository": "https://github.com/ashbuilds/payload-plugins",
"bugs": "https://github.com/ashbuilds/payload-ai/issues",
"repository": "https://github.com/ashbuilds/payload-ai",
"license": "MIT",
"author": "ashbuilds",
"type": "module",
Expand Down

0 comments on commit a186b03

Please sign in to comment.