Skip to content

Commit

Permalink
add ci for renamed branch, to use in new infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
clezag committed Dec 13, 2023
1 parent 128e363 commit 052609d
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/ci-renamed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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

0 comments on commit 052609d

Please sign in to comment.