update action's free disk tools #2
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
name: Publish Docker image | ||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
push_to_registry: | ||
name: Push Docker image to Docker Hub | ||
runs-on: ubuntu-latest | ||
steps: | ||
#- name: Delete huge unnecessary tools folder | ||
# run: | | ||
# rm -rf /opt/hostedtoolcache | ||
# rm -rf /usr/share/dotnet | ||
# rm -rf /opt/ghc | ||
# rm -rf "/usr/local/share/boost" | ||
# rm -rf "$AGENT_TOOLSDIRECTORY" | ||
- 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 | ||
docker-images: true | ||
swap-storage: true | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
logout: true | ||
- name: Get repo name | ||
id: repo_name | ||
run: echo "::set-output name=repo::$(echo ${{ github.repository }} | cut -d'/' -f2)" | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
${{ secrets.DOCKER_USERNAME }}/${{ steps.repo_name.outputs.repo }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |