-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (41 loc) · 1.52 KB
/
update_repo.yaml
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
name: Update Repository
# IMPORTANT: Only run on main/master branch.
on:
workflow_call:
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout user repo
uses: actions/checkout@v2
path: user_repo
- name: Install Dart
uses: dart-lang/setup-dart@v1
- name: Dart SDK Version
run: dart --version
- name: Prepare Codelessly Script Runner
run: |
rm -rf codelessly_script_runner
git clone https://github.com/Codelessly/codelessly_script_runner.git --single-branch
cd codelessly_script_runner
dart pub get
- name: Clone Latest Template
run: |
rm -rf codelessly_starter_brick
git clone https://github.com/Codelessly/codelessly_starter_brick.git --single-branch
- name: Run script
run: dart codelessly_script_runner/bin/main.dart codelessly_starter_brick/__brick__ ${{ secrets.CODELESSLY_PROJECT_CONFIG }}
- name: Commit and push changes
run: |
cd codelessly_starter_brick/__brick__
git init
git checkout -b main
git remote add origin https://github.repository_owner:${{ secrets.CODELESSLY_APP_ACCESS_TOKEN }}@github.com/${{ github.repository }}.git
git config user.name Codelessly
git config user.email codelessly@gmail.com
git add .
git commit -m "Update to latest template"
git push --force origin ${{ github.ref_name }}
- name: Finish
run: echo "Finished"