-
Notifications
You must be signed in to change notification settings - Fork 42
/
action.yml
52 lines (52 loc) · 1.63 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
name: 'Vue to Github Pages'
branding:
icon: 'activity'
color: 'blue'
description: 'This Action will Build your Vue Project and deploy it to Github Pages'
inputs:
username:
description: 'Your username'
required: true
reponame:
description: 'Your reponame'
required: true
token:
description: 'Your Github token'
required: true
gitemail:
description: 'Your git commit email'
required: false
default: '[email protected]'
gitname:
description: 'Your git commit name'
required: false
default: 'CI'
gitmsg:
description: 'Your git commit message'
required: false
default: 'deploy'
cname:
description: 'Your custom domain'
required: false
default: 'none'
useyarn:
description: 'Use yarn to build'
required: false
default: false
runs:
using: "composite"
steps:
- name: Build Vue
run: |
if [ true == ${{ inputs.useyarn }} ]; then yarn install --frozen-lockfile; else npm ci; fi
if [ true == ${{ inputs.useyarn }} ]; then yarn build; else npm run build; fi
cd dist
ln -s index.html 404.html
if [ "none" != ${{ inputs.cname }} ]; then echo '${{ inputs.cname }}' > CNAME; fi
git config --global user.email "${{ inputs.gitemail }}"
git config --global user.name "${{ inputs.gitname }}"
git init
git add -A
git commit -m '${{ inputs.gitmsg }}'
git push -f https://${{ inputs.username }}:${{ inputs.token }}@github.com/${{ inputs.username }}/${{ inputs.reponame }}.git master:gh-pages
shell: bash