Skip to content

Merge pull request #38 from AAFC-BICoE/34816_Allow_column_name_custom… #247

Merge pull request #38 from AAFC-BICoE/34816_Allow_column_name_custom…

Merge pull request #38 from AAFC-BICoE/34816_Allow_column_name_custom… #247

Workflow file for this run

name: Java CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Build with Maven
run: mvn -B -q verify
- name: Run Checkstyle
run: mvn -q checkstyle:check
- name: Run SpotBugs
run: mvn -q spotbugs:check
- name: Run OWASP dependency-check (only on dev)
run: mvn -q org.owasp:dependency-check-maven:check
if: ${{ github.ref == 'refs/heads/dev' }}
- name: Extract Version
if: ${{ github.ref == 'refs/heads/main' }}
run: |
mvn help:evaluate -Dexpression=project.version -q -DforceStdout > version.txt
- name: Store artifacts
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
version.txt
target/dina-export-api-*.jar
Dockerfile
push:
name: Build Docker Image and Push to DockerHub
needs: [build]
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Download artifacts from build job
uses: actions/download-artifact@v4
with:
name: build-artifacts
- name: Set VERSION_TAG ENV variable
run: |
echo "VERSION_TAG=$(cat version.txt)" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Image and Push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: aafcbicoe/dina-export-api:${{ env.VERSION_TAG }}
provenance: false