Skip to content

Commit

Permalink
feat: CI/CD for publishing smart forms renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
dhanifajar15 committed Sep 27, 2024
1 parent 1f3ebbc commit fb4d053
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 'Upstream Sync'
# on:
# schedule:
# # Cron job will run once a day at midnight
# - cron: '0 0 * * *'

on:
push:

workflow_dispatch: # click the button on Github repo!
inputs:
sync_test_mode: # Adds a boolean option that appears during manual workflow run for easy test mode config
description: 'Fork Sync Test Mode'
type: boolean
default: false


jobs:
sync_latest_from_upstream:
runs-on: ubuntu-latest
name: Sync latest commits from upstream repo

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: main
token: ${{ secrets.GITHUB_TOKEN }}

- name: Sync upstream changes
id: sync
uses: aormsby/[email protected]
with:
target_sync_branch: main
target_repo_token: ${{ secrets.GITHUB_TOKEN }}
upstream_sync_branch: main
upstream_sync_repo: aehrc/smart-forms

publish:
runs-on: ubuntu-latest
name: Publish Smart Forms Renderer
permissions:
contents: read
packages: write # allow GITHUB_TOKEN to publish packages
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
packages/smart-forms-renderer
- run: move packages/smart-forms-renderer/{.,}* .
- uses: actions/setup-node@v3
with:
node-version: "16.20.2"
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
registry: "https://registry.npmjs.org"

0 comments on commit fb4d053

Please sign in to comment.