Skip to content

Commit

Permalink
fix: workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
TsimurSh committed May 9, 2024
1 parent f5595c7 commit ebf9e73
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name: Java CI with Maven

on:
push:
branches: [ "main", "refactor" ]
branches: [ "main", "refactoring" ]
pull_request:
branches: [ "main" ]

Expand All @@ -20,25 +20,25 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
name: Checkout
- uses: actions/checkout@v3
name: Checkout

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Build with Maven
run: mvn -B package --file pom.xml

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
# - name: Update dependency graph
# uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6

container-image:
if: github.repository_owner == 'opentransportro' && github.event_name == 'push' && (github.ref == 'refs/heads/main')
if: github.repository_owner == 'goeuropa' && github.event_name == 'push' && (github.ref == 'refs/heads/main')
runs-on: ubuntu-latest
needs:
- build
Expand All @@ -57,24 +57,24 @@ jobs:
node-version: 18
- name: Build container image with Jib, push to Dockerhub
env:
CONTAINER_REPO: docker.io/otrro/transitclock-server
CONTAINER_REPO: docker.io/wkulesza/transitclock-server
CONTAINER_REGISTRY_USER: ${{secrets.DOCKER_USER}}
CONTAINER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_AUTH }}
CONTAINER_REGISTRY_PASSWORD: ${{secrets.DOCKER_AUTH}}
run: |
# we give the container two tags
# - "latest"
# - a string like "2.3_2022-12-12T21-38"
version_with_snapshot=`mvn -q help:evaluate -Dexpression=project.version -q -DforceStdout`
version=${version_with_snapshot/-SNAPSHOT/}
image_version=${version}
## if the Maven version contains SNAPSHOT, then add date to tag
if [[ $version_with_snapshot == *"SNAPSHOT"* ]]; then
image_date=`date +%Y-%m-%dT%H-%M`
image_version="${version}_${image_date}"
echo "Maven version ${version_with_snapshot} contains SNAPSHOT, adding date to container image tag"
fi
mvn install jib:build -Djib.to.tags=latest,$image_version

0 comments on commit ebf9e73

Please sign in to comment.