-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
66 lines (59 loc) · 1.65 KB
/
action.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
name: Generation github-page
author: lentryd
branding:
icon: book-open
color: white
description: GitHub action to create and publish a repository description to GitHub pages
inputs:
username:
required: true
description: Your username
reponame:
required: true
description: Your reponame
branch:
required: true
description: Your branch
gtag:
required: false
description: Your google analytic tag
token:
required: true
description: Your Github token
runs:
using: composite
steps:
- name: Checkout
uses: actions/[email protected]
with:
ref: "main"
repository: "lentryd/VDocs"
- name: Delete default .env
run: rm .env
shell: sh
- name: Installing Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- name: Installing dependencies
run: npm ci
shell: sh
- name: Build project
env:
VUE_APP_G_TOKEN: ${{ inputs.gtag }}
VUE_APP_GH_REPO: ${{ inputs.reponame }}
VUE_APP_GH_OWNER: ${{ inputs.username }}
VUE_APP_GH_BRANCH: ${{ inputs.branch }}
run: npm run build
shell: sh
- name: Push dist
run: |
cd dist
cp index.html 404.html
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git init
git add -A
git commit -m "update content"
git push -f https://${{ inputs.username }}:${{ inputs.token }}@github.com/${{ inputs.username }}/${{ inputs.reponame }}.git master:gh-pages
shell: sh