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 26e7b53
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- '1.*'
tags:
- '*'

Expand Down Expand Up @@ -46,6 +47,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 +66,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 26e7b53

Please sign in to comment.