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

build: skip login to docker hub and push step on error #676

Merged
merged 1 commit into from
Mar 22, 2024
Merged
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: 7 additions & 3 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
run:
echo ${{github.head_ref}}
- name: Log in to Docker Hub
continue-on-error: true
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20
with:
username: ${{ secrets.EDUNEXT_DOCKER_USERNAME }}
Expand All @@ -46,13 +47,16 @@ jobs:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Aspects Docker Images
run: |
tutor images build ${{ matrix.service.name }} --cache-to-registry -d '--tag=${{ matrix.service.repository }}:latest'
- name: Push docker image
continue-on-error: true
if: github.event.action == 'opened' || github.event.action == 'synchronize'
run: |
tutor images build ${{ matrix.service.name }}
tutor images push ${{ matrix.service.name }}
- name: Build Aspects Docker Images Latest
- name: Push latest docker image
continue-on-error: true
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'bot/v')
run: |
tutor images build ${{ matrix.service.name }} --cache-to-registry -d '--tag=${{ matrix.service.repository }}:latest'
tutor images push ${{ matrix.service.name }}
docker image push ${{ matrix.service.repository }}:latest