Skip to content

Commit

Permalink
build: freeing disk space Docker image building
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Oct 10, 2021
1 parent 15431a1 commit a6601f1
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/buildDockerImage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@ jobs:
runs-on: ubuntu-latest

steps:
# Free disk space
- name: Free up disk space
run: sudo rm -rf /usr/share/dotnet

# checkout repository
- name: Checkout repository
uses: actions/[email protected]
uses: actions/checkout@v2
with:
fetch-depth: 1

# Build Docker image
- id: get-timestamp
Expand All @@ -36,7 +43,12 @@ jobs:
image_tag: ${{github.sha}}
push_image_and_stages: true
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: "${{ secrets.DOCKER_REGISTRY_TOKEN }}"
password: "${{ secrets.DOCKER_REGISTRY_TOKEN }}"

- name: Clean up unnecessary images to free disk space
run: |
images=$(docker images | grep -v ${{github.sha}} | grep ago | awk '{print $3}')
docker rm -f $images
- name: Label base Docker image
run: |
Expand All @@ -57,8 +69,15 @@ jobs:
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: "${{ secrets.DOCKER_REGISTRY_TOKEN }}"

- name: Clean up unnecessary images to free disk space
run: |
images=$(docker images | grep -v ${{github.sha}} | grep ago | awk '{print $3}')
docker rm -f $images
- name: Label Docker image
run: |
docker image tag ghcr.io/biosimulators/biosimulators-base-stages:${{github.sha}} ghcr.io/biosimulators/biosimulators-base:${{github.sha}}
docker image tag ghcr.io/biosimulators/biosimulators-base-stages:${{github.sha}} ghcr.io/biosimulators/biosimulators-base:latest
docker image tag ghcr.io/biosimulators/biosimulators-stages:${{github.sha}} ghcr.io/biosimulators/biosimulators:${{github.sha}}
docker image tag ghcr.io/biosimulators/biosimulators-stages:${{github.sha}} ghcr.io/biosimulators/biosimulators:latest
Expand Down

0 comments on commit a6601f1

Please sign in to comment.