-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: freeing disk space Docker image building
- Loading branch information
Showing
1 changed file
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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: | | ||
|
@@ -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 | ||
|