-
Notifications
You must be signed in to change notification settings - Fork 4
65 lines (57 loc) · 1.74 KB
/
ci-renamed.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
name: CI
on:
push:
paths-ignore:
- 'client/**'
- '*.md'
pull_request:
paths-ignore:
- 'client/**'
- '*.md'
env:
PROJECT_NAME: odh-mobility-writer
DOCKER_IMAGE: ghcr.io/${{ github.repository }}/${{ github.event.repository.name }}-app
DOCKER_TAG: ${{ github.sha }}
JAVA_VERSION: '17'
jobs:
# Test
test:
runs-on: ubuntu-22.04
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v1
- name: Test code
uses: noi-techpark/github-actions/maven-test@v2
with:
java-version: ${{ env.JAVA_VERSION }}
test-command: 'mvn -B test'
# Deploy Test
build-renamed:
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/renamed'
needs: test
concurrency: build-renamed
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Build project
uses: noi-techpark/github-actions/maven-build@v2
with:
java-version: ${{ env.JAVA_VERSION }}
build-command: 'mvn -B -DskipTests -DfinalName=bdp --projects writer --also-make clean package'
- name: Build and push images
uses: noi-techpark/github-actions/docker-build-and-push@v2
with:
docker-username: ${{ github.actor }}
docker-password: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/shrink/actions-docker-registry-tag
- name: Add a "renamed" docker tag
uses: shrink/actions-docker-registry-tag@v2
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ github.event.repository.name }}-app
target: ${{ env.DOCKER_TAG }}
tags: |
renamed