-
Notifications
You must be signed in to change notification settings - Fork 7
66 lines (54 loc) · 2.22 KB
/
maven.yml
File metadata and controls
66 lines (54 loc) · 2.22 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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches: [ "main", "develop" ]
pull_request:
branches:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- name: Evaluate Nix expressions
run: |
nix-instantiate --expr '[ (import ./nix/github-workflow-dependencies.nix) (import ./default.nix)]' 2>&1 | grep -v '^warning: ' | tee derivations
echo 'dry build'
nix-store --realize --dry-run $(< derivations) 2>&1 | tee dry-build
echo 'to be fetched'
sed '1,/^these .* will be fetched/ d; s/^ //' dry-build | tee fetch
echo 'to be built'
sed -n '2,/^these .* will be fetched/ p' dry-build | grep -v '^these' | sed 's/ //' | tee built
- name: Fetch
run: nix-store --realize $(< fetch)
- name: Build
run: nix-store --realize $(< built)
- name: Upload Javadoc artifact
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
uses: actions/upload-pages-artifact@v3
with:
path: result/share/github-pages/DiffDetective
# An additional job is recommened in the documentation of `actions/deploy-pages`
deploy-javadoc:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
needs: build
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
steps:
- name: Publish Javadoc to Github Pages
id: deployment
uses: actions/deploy-pages@v4
# Kill in progress deployments because only the newest version is relevant
# and concurrent deployments cause CI failures.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true