Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push Docker images for tags only #3008

Merged
merged 2 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .github/workflows/build-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,13 @@ jobs:
run: make test-ui

- name: Build production image
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
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