Skip to content

Commit

Permalink
Update upload-model-to-dockerhub.yml
Browse files Browse the repository at this point in the history
with latest action versions and a new action to free up space on the runner OS.
  • Loading branch information
DhanshreeA authored Mar 14, 2024
1 parent 1e1dcf5 commit 0602916
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/upload-model-to-dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,19 @@ name: Upload model to DockerHub
on:
workflow_dispatch:

workflow_run:
workflows: ["Upload model to S3"]
types:
- completed

jobs:
upload_model_to_dockerhub:
if: ${{ github.repository != 'ersilia-os/eos-template' && github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.repository != 'ersilia-os/eos-template' }}
runs-on: ubuntu-latest
steps:
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3

# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

# log in to dockerhub
- name: Login to Docker Hub
Expand All @@ -35,7 +30,22 @@ jobs:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
lfs: 'true'

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: true

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true

- name: Generate the Dockerfile
id: generate-dockerfile
env:
Expand All @@ -44,11 +54,11 @@ jobs:
wget https://raw.githubusercontent.com/ersilia-os/ersilia/master/.github/scripts/place_a_dockerfile_in_current_eos_repo.py
python -m pip install requests
python place_a_dockerfile_in_current_eos_repo.py $REPO_NAME
- name: Build and push
id: buildMultiple
continue-on-error: true
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
Expand All @@ -69,7 +79,7 @@ jobs:
- name: Build only for Linux/amd64
id: buildSingle
if: steps.buildCheck.outputs.failed == 'true'
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
Expand Down

0 comments on commit 0602916

Please sign in to comment.