-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (118 loc) · 4.02 KB
/
ci.yml
File metadata and controls
127 lines (118 loc) · 4.02 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: CI
on:
push:
branches:
- develop
pull_request:
types: [opened, synchronize]
workflow_dispatch:
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Cache NPM
uses: actions/cache@v5
with:
path: .cache/npm
key: ${{ runner.os }}-npm-cache
- name: Install Dependencies
run: npm install --quiet --no-progress --cache=.cache/npm
lint:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v5
- name: Cache NPM
uses: actions/cache@v5
with:
path: .cache/npm
key: ${{ runner.os }}-npm-cache
- name: Install Dependencies
run: npm install --quiet --no-progress --cache=.cache/npm
- name: Lint
run: node_modules/.bin/gulp lint
bundle-stable:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop'
needs: setup
steps:
- uses: actions/checkout@v5
- name: Cache NPM
uses: actions/cache@v5
with:
path: .cache/npm
key: ${{ runner.os }}-npm-cache
- name: Install Dependencies
run: npm install --quiet --no-progress --cache=.cache/npm
- name: Bundle
run: node_modules/.bin/gulp bundle
- name: Upload Artifact
uses: actions/upload-artifact@v6
with:
name: ui-bundle
path: build/ui-bundle.zip
bundle-dev:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop'
needs: setup
steps:
- uses: actions/checkout@v5
- name: Cache NPM
uses: actions/cache@v5
with:
path: .cache/npm
key: ${{ runner.os }}-npm-cache
- name: Install Dependencies
run: npm install --quiet --no-progress --cache=.cache/npm
- name: Bundle
run: node_modules/.bin/gulp bundle
- name: Upload Artifact
uses: actions/upload-artifact@v6
with:
name: ui-bundle
path: ui-bundle.zip
retention-days: 1
upload:
name: Create release and upload artifacts
needs:
- bundle-stable
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v6
- name: Inspect directory after downloading artifacts
run: ls -alFR
- name: Create release and upload artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
chmod +x pyuploadtool-x86_64.AppImage
artifact_path="$(find . -type f -name 'ui-bundle.zip' -print -quit)"
test -n "$artifact_path"
./pyuploadtool-x86_64.AppImage "$artifact_path"
dispatch-documentation-redeploy:
name: Trigger documentation rebuild
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
needs:
- upload
runs-on: ubuntu-latest
steps:
- name: Dispatch rebuild to documentation repo
env:
GH_TOKEN_RAW: ${{ secrets.DOCS_REPO_DISPATCH_TOKEN }}
run: |
export GH_TOKEN="$(printf %s "$GH_TOKEN_RAW" | tr -d '\r\n')"
jq -nc \
--arg source_repo "$GITHUB_REPOSITORY" \
--arg source_path "https://github.com/$GITHUB_REPOSITORY/releases/download/continuous/ui-bundle.zip" \
--arg sha "$GITHUB_SHA" \
--arg message "${{ github.event.head_commit.message }}" \
--arg author "${{ github.event.head_commit.author.name }}" \
--arg changed_files "${{ join(github.event.head_commit.modified, ',') }}" \
'{event_type:"docs-updated",client_payload:{source_repo:$source_repo,source_path:$source_path,sha:$sha,message:$message,author:$author,changed_files:$changed_files}}' \
> dispatch-payload.json
gh api repos/9kit-com/documentation/dispatches \
--method POST \
--input dispatch-payload.json