Skip to content

Commit

Permalink
Add continuous deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wKovacs64 committed Jul 27, 2024
1 parent d20aace commit 647789c
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 🌐 CD

on:
push:
pull_request:
pull_request_review:
types: [submitted]

jobs:
publish_to_pkg_pr_new:
runs-on: ubuntu-latest
if: |
github.event_name != 'push' ||
!contains(github.event.head_commit.message, 'chore: release')
steps:
- name: Bail early if PR is from a fork and not approved
if: |
github.event_name == 'pull_request_review' &&
github.event.pull_request.head.repo.fork == true &&
github.event.review.state != 'approved'
run: |
echo "PR from fork is not approved. Skipping workflow."
exit 78
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
cache: npm
node-version-file: '.nvmrc'

- name: 📥 Install deps
run: npm install

- name: 🛠️ Build
run: npm run build

- name: ⚡ pkg.pr.new
run: npx --yes pkg-pr-new publish --compact --no-template

0 comments on commit 647789c

Please sign in to comment.