Weekly Build #69
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected] | |
with: | |
name: updatesite | |
path: releng/edu.kit.ipd.are.ecore2owl.updatesite/target/repository | |
- name: Checkout gh-pages | |
uses: actions/[email protected] | |
with: | |
ref: gh-pages | |
- name: Remove temporary updatesite folder | |
run: rm -rf updatesite | |
- name: Download artifact | |
uses: actions/[email protected] | |
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 "[email protected]" | |
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 }} | |