Skip to content

Commit

Permalink
ENH: Retain docker image from PRs (#1685)
Browse files Browse the repository at this point in the history
* ENH: Retain docker image from PRs

This will make it easier to quickly download and test PRs, using temporary
Github artifacts that expire after 7 days. Load into docker using the terminal:

unzip ants_image.tar.zip
docker load -i ants_image.tar
  • Loading branch information
cookpa committed Feb 29, 2024
1 parent 4b13b0c commit ffa9d89
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/ci-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,24 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
name: Build and load (PR) or push (commit/tag)
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: .
push: ${{ github.event_name != 'pull_request' }}
load: ${{ github.event_name == 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
-
name: Export Docker image for PR
if: github.event_name == 'pull_request'
run: |
docker save antsx/ants:${{ steps.meta.outputs.version }} > ants_image.tar
-
name: Upload PR Docker image as artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v3
with:
name: ants-docker-image
path: ants_image.tar
retention-days: 7

0 comments on commit ffa9d89

Please sign in to comment.