Skip to content

Commit

Permalink
chore: push branch
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed Sep 10, 2024
1 parent 7fed985 commit 80287a4
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- '*'
pull_request:

env:
BRANCH_NAME: ${{ github.base_ref || github.ref_name }}

jobs:
build:

Expand Down Expand Up @@ -39,6 +42,11 @@ jobs:
id: version
run: echo ::set-output name=VERSION::$(./mvnw -f src/services/ogc-features/ help:evaluate -q -DforceStdout -Dexpression=project.version -ntp)

- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Login to DockerHub
if: github.repository == 'georchestra/data-api' && github.actor != 'dependabot[bot]' && (github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v'))
uses: docker/login-action@v2
Expand All @@ -47,14 +55,14 @@ jobs:
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: push the lastest docker image
if: github.repository == 'georchestra/data-api' && github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/main'
if: github.repository == 'georchestra/data-api' && github.actor != 'dependabot[bot]' && (github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v'))
run: |
docker push georchestra/data-api:latest
- name: push the release branch or tag docker image
if: github.repository == 'georchestra/data-api' && github.actor != 'dependabot[bot]' && (contains(github.ref, 'refs/heads/1.') || startsWith(github.event.ref, 'refs/tags/v'))
if: github.repository == 'georchestra/data-api' && github.actor != 'dependabot[bot]' && contains(github.ref, 'refs/heads/1.')
run: |
docker push georchestra/data-api:${{ steps.version.outputs.VERSION }}
docker push georchestra/data-api:${{ env.BRANCH_NAME }}
- name: "Update Docker Hub Description"
if: github.ref == 'refs/heads/main' && github.repository == 'georchestra/data-api' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
Expand Down

0 comments on commit 80287a4

Please sign in to comment.