-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (44 loc) · 1.6 KB
/
build.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
# https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- uses: actions/checkout@v3
# https://github.com/actions/setup-java
# https://github.com/actions/cache
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
# https://github.com/gradle/gradle
- run: chmod +x gradlew
- run: ./gradlew eclipse
- run: ./gradlew build --parallel
- run: ./gradlew asciidoctor
- run: ./gradlew jacocoTestReport
- run: ./gradlew dockerBuild
# https://github.com/features/packages
- if: startsWith(github.ref, 'refs/tags')
name: Update Packages (tag)
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
API=`echo "ghcr.io/${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]'`
TAG=`cat VERSION`
CLIENT=demoscs/client
docker tag $CLIENT:$TAG $API/$CLIENT:$TAG
docker push $API/$CLIENT:$TAG
SERVER=demoscs/server
docker tag $SERVER:$TAG $API/$SERVER:$TAG
docker push $API/$SERVER:$TAG
# https://github.com/peaceiris/actions-gh-pages
- if: startsWith(github.ref, 'refs/tags')
name: Update Pages (tag)
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: pages