-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (66 loc) · 2.13 KB
/
ci.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Scala build and test
on: [push, pull_request]
jobs:
# Label of the container job
mvn-build-test:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
container: maven:3.8-openjdk-11
steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v2
- name: Cache mvn cache
id: mvn-cache
uses: actions/cache@v2
with:
path: |
~/.m2
key: ${{ runner.os }}--${{ hashFiles('pom.xml') }}
- name: Verify
run: mvn verify
- name: Upload dist
uses: actions/upload-artifact@v2
with:
name: rpki-irr-bgp-stats-dist
path: target/rpki-irr-bgp-stats-dist.tar.gz
- name: Upload reports
uses: actions/upload-artifact@v2
with:
name: reports
path: |
target/surefire-reports/**/*
docker:
runs-on: ubuntu-latest
needs: mvn-build-test
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: checkout sources
uses: actions/checkout@v2
- name: Fetch dist
uses: actions/download-artifact@v2
with:
name: rpki-irr-bgp-stats-dist
- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
id: docker_build_rpki_irr_bgp_stats
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: ghcr.io/ripe-ncc/rpki-irr-bgp-stats:latest
labels: "org.label-schema.vcs-ref=${{ github.sha }}"
build-args: |
RPKI_IRR_BGP_STATS_DIST=./rpki-irr-bgp-stats-dist.tar.gz
- name: Image digest
run: echo ${{ steps.docker_build_rpki_irr_bgp_stats.outputs.digest }}