forked from sveltia/sveltia-cms-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 1.25 KB
/
main.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
name: Build and Push bit-SveliaCMS to singtonic
on:
push:
branches:
- main # Trigger on push to the main branch. Adjust if needed.
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # Specify the Node.js version needed
- name: Install dependencies
run: npm install
- name: Build Svelte project
run: npm run build
- name: Deploy to another repository
run: |
git config --global user.name "GitHub Action"
git config --global user.email "[email protected]"
git clone --depth=1 [email protected]:baenecke-it/singtonic.git target-repo
cp -r dist/sveltia-cms.js target-repo/static/admin/ # Copy the output file to the specific subfolder
cd target-repo
git add static/admin/sveltia-cms.js # Only add the specific file
git commit -m "Update sveltia-cms.js from ${GITHUB_REPOSITORY}"
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} # If using SSH, otherwise omit this line