-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (67 loc) · 2.28 KB
/
weekly.yml
File metadata and controls
84 lines (67 loc) · 2.28 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Weekly Build
on:
schedule:
- cron: '4 4 * * 0' #(once a week, Sundays at 04:04 UTC.)
workflow_dispatch: # manual trigger
jobs:
check_date:
runs-on: ubuntu-latest
name: Check latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@v2
- name: print latest_commit
run: echo ${{ github.sha }}
- id: should_run
continue-on-error: true
name: check latest commit is less than a week
if: ${{ github.event_name == 'schedule' }}
run: test -z $(git rev-list --after="1 week" ${{ github.sha }}) && echo "::set-output name=should_run::false"
build:
needs: check_date
if: ${{ needs.check_date.outputs.should_run != 'false' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: maven-settings-xml-action
uses: whelk-io/maven-settings-xml-action@v4
with:
servers: '[{ "id": "github", "username": "x-access-token", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Upload Updatesite
uses: actions/upload-artifact@v1.0.0
with:
name: updatesite
path: releng/edu.kit.ipd.are.ecore2owl.updatesite/target/repository
- name: Checkout gh-pages
uses: actions/checkout@v2.0.0
with:
ref: gh-pages
- name: Remove temporary updatesite folder
run: rm -rf updatesite
- name: Download artifact
uses: actions/download-artifact@v4.1.7
with:
name: updatesite
path: updatesite
- name: Get current README
run: wget -O README.md https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/master/README.md
- name: Commit
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -f updatesite/* README.md
git commit -m "Automated commit"
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
tags: false
#force: true
github_token: ${{ secrets.GITHUB_TOKEN }}