-
Notifications
You must be signed in to change notification settings - Fork 11
63 lines (53 loc) · 1.59 KB
/
site.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
name: site
permissions:
deployments: write
pages: write
on:
workflow_call:
inputs:
tag:
description: "Tag to use for site deployment"
required: true
type: string
workflow_dispatch:
inputs:
tag:
description: "Tag to use for site deployment"
required: true
type: string
jobs:
deploy-site:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
ref: hps-java-${{ inputs.tag }}
- name: Validate tag
run: |
if [ "$(git name-rev --name-only --tags HEAD)" == "undefined" ]; then
echo "ERROR: Reference used as input is not a valid tag."
exit 1
fi
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Get email
id: get_email
uses: evvanErb/[email protected]
with:
github-username: ${{ github.actor }}
- name: Configure Git user
run: |
git config --global user.email "${{ steps.get_email.outputs.email }}"
git config --global user.name "${{ github.actor }}"
echo "Username: ${{ github.actor }}"
echo "Email: ${{ steps.get_email.outputs.email }}"
- name: Build project and run tests
run: mvn clean install verify
- name: Build and deploy the site
run: mvn site site:stage scm-publish:publish-scm -q