forked from placeDE/pixel
-
Notifications
You must be signed in to change notification settings - Fork 6
63 lines (51 loc) · 1.85 KB
/
buildTemplate.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
63
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Build json and pixelart
on:
workflow_dispatch:
pull_request:
types:
- closed
push:
paths-ignore:
- 'output.png'
- 'pixel.json'
permissions:
contents: write
jobs:
run_generation:
if: github.event.pull_request.merged == true && ${{ github.base_ref == 'main' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Setup python
uses: actions/setup-python@v2
- name: Install Python dependencies
uses: py-actions/py-dependency-install@v3
with:
path: "scripts/requirements.txt"
- name: fetch from master
run: git fetch origin ${{ github.ref_name }}
- name: Generate json
run: python scripts/generate_json.py --config config.toml
shell: sh
- name: Generate Pixelart
run: python scripts/render_json.py
shell: sh
- name: Generate Shadowmap
run: python scripts/render_json_shadow.py
shell: sh
- name: Commit files
run: |
git config --local user.email "somemail@domain.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "Add changes" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref_name }}