-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
54 lines (50 loc) · 1.57 KB
/
action.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
name: 'Generate Repository'
description: 'Automatically generate a repo branch from an Unmanic repo source directory'
inputs:
python_version:
description: 'Python version for setup'
required: false
default: '3.11'
node_version:
description: 'Node version for setup'
required: false
default: '20'
deploy_repo:
description: 'Boolean to determine if the repository should be deployed'
required: false
default: 'true'
github_token:
description: 'A GitHub token with the permissions to push back to this repository'
required: true
default: ${{ github.token }}
runs:
using: 'composite'
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
- name: Check repo for config file
shell: bash
run: |
if [ ! -e ./config.json ]; then
echo "Unable to build repo. Missing config.json file."
exit 1
fi
- name: Build repository
shell: bash
run: |
python3 "${{ github.action_path }}/generate_repository.py"
- name: Deploy repository
if: ${{ inputs.deploy_repo == 'true' }} && success() && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/official')
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: repo
FOLDER: repo
SQUASH_HISTORY: 'true'
GITHUB_TOKEN: ${{ inputs.github_token }}