-
Notifications
You must be signed in to change notification settings - Fork 3
35 lines (29 loc) · 934 Bytes
/
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
name: React app deployement
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Restore CI Cache
uses: actions/cache@v2
id: cache
with:
path: node_modules
key: ${{ runner.os }}-16-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
if: ${{ !steps.cache.outputs.cache-hit }}
run: yarn --frozen-lockfile
- run: |
npm ci
npm run build
echo "matikkaeditori.fi" >> dist/CNAME
echo "VERSION: " >> dist/VERSION
echo $(git rev-parse --short "$GITHUB_SHA") >> dist/VERSION
git config user.name github-actions
git config user.email [email protected]
git --work-tree dist add --all
git commit -m "Automatic React build & deploy"
git push origin HEAD:gh-pages --force