Skip to content

Commit

Permalink
Push Docker images for tags only
Browse files Browse the repository at this point in the history
We have implemented a process that uses release candidates for pre-release testing and deployments, so there’s no need anymore to push Docker images for every commit. This is wasteful in terms of bandwidth and storage resources and clutters the image repository.
  • Loading branch information
tillprochaska committed Apr 25, 2023
1 parent 7307a29 commit 063b1b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/build-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,10 @@ jobs:
- name: Build production image
run: docker build -t ghcr.io/alephdata/aleph-ui-production:${GITHUB_SHA} -f ui/Dockerfile.production ui

- name: Push docker image (hash)
env:
GITHUB_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
if: env.GITHUB_PASSWORD != null
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
docker push ghcr.io/alephdata/aleph-ui-production:${GITHUB_SHA}
- name: Push docker image (tagged)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
export ALEPH_TAG=${GITHUB_REF/refs\/tags\//}
docker tag ghcr.io/alephdata/aleph-ui-production:${GITHUB_SHA} ghcr.io/alephdata/aleph-ui-production:${ALEPH_TAG};
docker push ghcr.io/alephdata/aleph-ui-production:${ALEPH_TAG};
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,10 @@ jobs:
- name: Run aleph tests
run: make ALEPH_TAG=${GITHUB_SHA} test

- name: Push docker image (hash)
env:
GITHUB_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
if: env.GITHUB_PASSWORD != null
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
docker push ghcr.io/alephdata/aleph:${GITHUB_SHA}
- name: Push docker images for tags
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
export ALEPH_TAG=${GITHUB_REF/refs\/tags\//}
docker tag ghcr.io/alephdata/aleph:${GITHUB_SHA} ghcr.io/alephdata/aleph:${ALEPH_TAG};
docker push ghcr.io/alephdata/aleph:${ALEPH_TAG};
Expand Down

0 comments on commit 063b1b9

Please sign in to comment.