From 052609df0b4155cdb084ae5ecb5960fddabf576e Mon Sep 17 00:00:00 2001 From: Clemens Zagler Date: Wed, 13 Dec 2023 10:00:37 +0100 Subject: [PATCH] add ci for renamed branch, to use in new infrastructure --- .github/workflows/ci-renamed.yml | 65 ++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/ci-renamed.yml diff --git a/.github/workflows/ci-renamed.yml b/.github/workflows/ci-renamed.yml new file mode 100644 index 00000000..80cc748c --- /dev/null +++ b/.github/workflows/ci-renamed.yml @@ -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 \ No newline at end of file