-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (55 loc) · 1.6 KB
/
main.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
64
65
66
67
name: build_app
on:
push:
branches:
- main
workflow_dispatch:
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Generate version
run: |
NEW_VERSION=$(date +%Y.%m.%d)-${{ github.run_number }}
echo '{"schemaVersion": 1, "label": "dev-version", "message": "'$NEW_VERSION'", "color": "blue"}' > version-badge.json
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add version-badge.json
git commit -m "Update version to $NEW_VERSION"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Verify pushed changes
run: git log -1
build_app:
needs: update-version
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.10.x]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Pull latest changes
run: git pull origin main
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Build app
run: npm run build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.6.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: build
FOLDER: dist
CLEAN: true