-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (31 loc) · 1.09 KB
/
publish-ghpages.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
name: Publish SAK's GitHub Pages
on:
push:
branches: [ main ]
paths: [ 'projects/sak/**/*', '.github/workflows/publish-ghpages.yml' ]
jobs:
build:
runs-on: ubuntu-latest
name: Build
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: 12
- name: Build site
id: build
run: |
yarn install
echo "##[set-output name=version;]$(npm version patch --no-git-tag-version)"
yarn ng build --prod --output-path=docs --base-href=https://gdoor-sistemas.github.io/sak/
cp docs/index.html docs/404.html
- name: Publish docs to repo
run: |
git config user.email "${{ github.actor }}@users.noreply.github.com"
git config user.name "${{ github.actor }}"
REMOTE=https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git add docs/*
git add package.json
git commit -m "docs: updates github page (${{ steps.build.outputs.version }})"
git pull $REMOTE
git push $REMOTE