-
Notifications
You must be signed in to change notification settings - Fork 13
63 lines (53 loc) · 1.95 KB
/
deploy.yml
File metadata and controls
63 lines (53 loc) · 1.95 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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Deploy
on:
push:
branches:
- master
jobs:
updateLayouts:
runs-on: ubuntu-latest
if: github.repository_owner == 'ThemezerNX'
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: 20
- name: Install dependencies
run: pnpm install
- name: Verify all layouts
run: pnpm run test
- name: Prettify
run: pnpm run prettify
- name: Push changes
run: |
git config user.name github-actions
git config user.email [email protected]
if [[ `git status --porcelain --untracked-files=no` ]]; then
git commit -am "Prettify & Automated UUID generation"
git push
fi
- name: Get new SHA after push
id: newsha
run: |
# Only get SHA if something was committed
if [[ `git status --porcelain --untracked-files=no` ]]; then
git commit -am "Prettify & Automated UUID generation"
git push
fi
echo "NEW_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Deploy
uses: fjogeleit/http-request-action@v1
with:
url: 'https://api.themezer.net/switch/layouts/run-update'
method: 'POST'
bearerToken: ${{ secrets.THEMEZER_BEARER_TOKEN }}
timeout: 30000
customHeaders: '{"Content-Type": "application/json"}'
data: '{"sha": "${{ env.NEW_SHA }}", "branch": "${{ github.ref }}"}'