Skip to content

Commit

Permalink
feat: push commit to ghcr, keep clean dockerhub release
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed Jul 11, 2024
1 parent 4f88323 commit 1a6eb5e
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ jobs:
if: github.ref == 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway'
run: docker push georchestra/gateway:latest

- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/1.') && github.repository == 'georchestra/georchestra-gateway' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/gateway:${{ steps.version.outputs.VERSION }}
- name: "Push tagged image to docker.io"
if: github.ref_type == 'tag' && github.ref != 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway'
run: docker push georchestra/gateway:${{ steps.version.outputs.VERSION }}
Expand All @@ -60,11 +65,19 @@ jobs:
readme-filepath: ./DOCKER_HUB.md
short-description: 'Gateway module for the geOrchestra SDI'

- name: Login to GitHub Container Registry
if: github.ref == 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: "Push image attached to commit id to docker.io"
if: github.ref == 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway'
run: |
docker tag georchestra/gateway:latest georchestra/gateway:commit-${{ github.sha }}
docker push georchestra/gateway:commit-${{ github.sha }}
docker tag georchestra/gateway:latest ghcr.io/georchestra/georchestra-gateway/gateway:commit-${{ github.sha }}
docker push ghcr.io/georchestra/georchestra-gateway/gateway:commit-${{ github.sha }}
- name: "Remove SNAPSHOT jars from repository"
run: |
Expand Down

0 comments on commit 1a6eb5e

Please sign in to comment.