Skip to content

Commit a13830e

Browse files
feat: create workflow to deploy
1 parent 0f25be7 commit a13830e

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/releaser.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
6+
name: CI Release Dist
7+
8+
jobs:
9+
build-and-deploy:
10+
name: Build and Deploy
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-versions:
17+
- 20
18+
19+
steps:
20+
- name: Cancel Previous Runs
21+
uses: styfle/cancel-workflow-action@0.12.0
22+
with:
23+
access_token: ${{ github.token }}
24+
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
- uses: actions/setup-node@v4
31+
with:
32+
node-version: ${{ matrix.node-versions }}
33+
34+
- name: NPM Install
35+
working-directory: ./ui
36+
run: npm install
37+
38+
- name: Lint
39+
working-directory: ./ui
40+
run: |
41+
npm run lint
42+
43+
- name: Export dist to resources for Laravel
44+
working-directory: ./ui
45+
run: |
46+
npm run export
47+
48+
- name: Create Pull Request
49+
uses: peter-evans/create-pull-request@v5
50+
with:
51+
commit-message: (action) Update dist
52+
title: (action) Update dist from build
53+
branch: update-dist
54+
base: master
55+
56+
- name: Export dist to resources for gh-pages
57+
working-directory: ./ui
58+
run: |
59+
PUBLIC_BASE=laravel-api-auto-docs npm run export
60+
61+
- name: .nojekyll
62+
run: touch ./resources/dist/.nojekyll
63+
64+
- name: Deploy Demo
65+
uses: peaceiris/actions-gh-pages@v3
66+
with:
67+
github_token: ${{ secrets.GITHUB_TOKEN }}
68+
publish_dir: ./resources/dist
69+
publish_branch: gh-pages

0 commit comments

Comments
 (0)