forked from aehrc/smart-forms
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 1.66 KB
/
sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: 'Upstream Sync'
on:
schedule:
# Cron job will run once a day at midnight
- cron: '0 0 * * *'
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
- name: Remove all except 'packages'
run: |
find . -maxdepth 1 ! -name 'packages' ! -name '.' -exec rm -rf {} +
- name: Move 'packages/smart-forms-renderer' to root
run: |
shopt -s dotglob
cp -r packages/smart-forms-renderer/* .
- run: rm -rf packages
- 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"