Skip to content

Commit

Permalink
skip pushing docker images on pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
edevosc2c committed Sep 21, 2023
1 parent 6aaecbd commit 96ea74d
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 38 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,35 +46,37 @@ jobs:
run: ../mvnw --no-transfer-progress clean package docker:build -Pdocker,log4j-logstash,sentry-log4j -DdockerImageName=georchestra/analytics:${{ steps.version.outputs.VERSION }} -DskipTests

- name: "Logging in docker.io"
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
uses: azure/docker-login@v1
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'

- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker tag georchestra/analytics:${{ steps.version.outputs.VERSION }} georchestra/analytics:latest
docker push georchestra/analytics:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/analytics:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/analytics:${{ steps.version.outputs.VERSION }}
- name: "Publish war in artifactory"
run: ./mvnw deploy --no-transfer-progress -B -P-all,analytics -DskipTests
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
continue-on-error: true
env:
ARTIFACTORY_TOKEN_REF: ${{ secrets.ARTIFACTORY_TOKEN }}
ARTIFACTORY_USERNAME_REF: ${{ secrets.ARTIFACTORY_USERNAME }}

- name: "Remove SNAPSHOT jars from repository"
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
10 changes: 6 additions & 4 deletions .github/workflows/console.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,35 +59,37 @@ jobs:
run: ../mvnw --no-transfer-progress clean package docker:build -Pdocker,log4j-logstash,sentry-log4j -DdockerImageName=georchestra/console:${{ steps.version.outputs.VERSION }} -DskipTests

- name: "Logging in docker.io"
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
uses: azure/docker-login@v1
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'

- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker tag georchestra/console:${{ steps.version.outputs.VERSION }} georchestra/console:latest
docker push georchestra/console:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/console:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/console:${{ steps.version.outputs.VERSION }}
- name: "Publish war in artifactory"
run: ./mvnw deploy -pl :console --also-make -P-all,console --no-transfer-progress -DskipTests
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
continue-on-error: true
env:
ARTIFACTORY_TOKEN_REF: ${{ secrets.ARTIFACTORY_TOKEN }}
ARTIFACTORY_USERNAME_REF: ${{ secrets.ARTIFACTORY_USERNAME }}

- name: "Remove SNAPSHOT jars from repository"
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
8 changes: 4 additions & 4 deletions .github/workflows/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ jobs:
run: docker build -t georchestra/database:${{ steps.version.outputs.VERSION }} .

- name: "Logging in docker.io"
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
uses: azure/docker-login@v1
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'

- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker tag georchestra/database:${{ steps.version.outputs.VERSION }} georchestra/database:latest
docker push georchestra/database:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/database:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/database:${{ steps.version.outputs.VERSION }}
8 changes: 5 additions & 3 deletions .github/workflows/datafeeder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
run: ./mvnw -f datafeeder-ui/ clean package docker:build -Pdocker -DskipTests -DdockerImageName=georchestra/datafeeder-frontend:${{ steps.version.outputs.VERSION }}

- name: "Logging in docker.io"
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
uses: azure/docker-login@v1
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
Expand All @@ -77,24 +77,26 @@ jobs:
docker push georchestra/datafeeder-frontend:latest
- name: "Pushing release branch to docker.io (22.x series)"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/datafeeder:${{ steps.version.outputs.VERSION }}
docker push georchestra/datafeeder-frontend:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io (22.x series)"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/datafeeder:${{ steps.version.outputs.VERSION }}
docker push georchestra/datafeeder-frontend:${{ steps.version.outputs.VERSION }}
- name: "Publish war in artifactory"
run: ./mvnw deploy -pl :datafeeder -P-all,datafeeder -DskipTests -ntp -Dfmt.skip=true
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
continue-on-error: true
env:
ARTIFACTORY_TOKEN_REF: ${{ secrets.ARTIFACTORY_TOKEN }}
ARTIFACTORY_USERNAME_REF: ${{ secrets.ARTIFACTORY_USERNAME }}

- name: "Remove SNAPSHOT jars from repository"
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
8 changes: 4 additions & 4 deletions .github/workflows/geonetwork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,22 @@ jobs:
- name: "Logging in docker.io"
uses: azure/docker-login@v1
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'

- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/geonetwork:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/geonetwork:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/geonetwork:${{ steps.version.outputs.VERSION }}
9 changes: 5 additions & 4 deletions .github/workflows/geoserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,31 +58,32 @@ jobs:

- name: "Logging in docker.io"
uses: azure/docker-login@v1
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'

- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker tag georchestra/geoserver:${{ steps.version.outputs.VERSION }} georchestra/geoserver:latest
docker tag georchestra/geoserver:${{ steps.version.outputs.VERSION }}-geofence georchestra/geoserver:geofence
docker push georchestra/geoserver:latest
docker push georchestra/geoserver:geofence
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/geoserver:${{ steps.version.outputs.VERSION }}
docker push georchestra/geoserver:${{ steps.version.outputs.VERSION }}-geofence
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/geoserver:${{ steps.version.outputs.VERSION }}
docker push georchestra/geoserver:${{ steps.version.outputs.VERSION }}-geofence
- name: "Remove SNAPSHOT jars from repository"
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
9 changes: 5 additions & 4 deletions .github/workflows/geowebcache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,29 @@ jobs:
run: ../mvnw --no-transfer-progress clean package docker:build -Pdocker,log4j-logstash,sentry-log4j -DdockerImageName=georchestra/geowebcache:${{ steps.version.outputs.VERSION }} -DskipTests

- name: "Logging in docker.io"
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
uses: azure/docker-login@v1
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'

- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker tag georchestra/geowebcache:${{ steps.version.outputs.VERSION }} georchestra/geowebcache:latest
docker push georchestra/geowebcache:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/geowebcache:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/geowebcache:${{ steps.version.outputs.VERSION }}
- name: "Remove SNAPSHOT jars from repository"
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
10 changes: 6 additions & 4 deletions .github/workflows/header.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,34 +47,36 @@ jobs:

- name: "Logging in docker.io"
uses: azure/docker-login@v1
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'

- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker tag georchestra/header:${{ steps.version.outputs.VERSION }} georchestra/header:latest
docker push georchestra/header:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/header:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/header:${{ steps.version.outputs.VERSION }}
- name: "Publish war in artifactory"
run: ./mvnw deploy --no-transfer-progress -B -P-all,header -DskipTests
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
continue-on-error: true
env:
ARTIFACTORY_TOKEN_REF: ${{ secrets.ARTIFACTORY_TOKEN }}
ARTIFACTORY_USERNAME_REF: ${{ secrets.ARTIFACTORY_USERNAME }}

- name: "Remove SNAPSHOT jars from repository"
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
6 changes: 3 additions & 3 deletions .github/workflows/ldap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ jobs:
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'

- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker tag georchestra/ldap:${{ steps.version.outputs.VERSION }} georchestra/ldap:latest
docker push georchestra/ldap:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/ldap:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/ldap:${{ steps.version.outputs.VERSION }}
Loading

0 comments on commit 96ea74d

Please sign in to comment.