chore(deps): update docker/build-push-action action to v6.7.0 #215
Workflow file for this run
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: Builds | |
on: | |
push: | |
# branches-ignore: | |
# - main | |
# - dev/** | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- main | |
types: | |
- closed | |
- opened | |
- reopened | |
- synchronize | |
- auto_merge_enabled | |
schedule: | |
- cron: '00 02 1 * *' | |
workflow_dispatch: | |
inputs: | |
rebuild: | |
description: "Re build container?" | |
required: true | |
default: "false" | |
type: choice | |
options: | |
- "true" | |
- "false" | |
no-cache: | |
description: "Build docker images with no cache" | |
default: false | |
required: false | |
type: boolean | |
jobs: | |
builds: | |
name: Container ${{ matrix.type }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 90 | |
strategy: | |
max-parallel: 5 | |
matrix: | |
type: | |
- cuda | |
- ubuntu2204 | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Remove unnecessary files | |
run: | | |
set -eux | |
docker images | |
sudo rm -rf "/opt/ghc" || true | |
sudo rm -rf "/usr/share/dotnet" || true | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" || true | |
sudo rm -rf "/usr/local/lib/android" || true | |
sudo rm -rf "/usr/local/share/boost" || true | |
docker rmi $(docker image ls -q --filter "reference=node*") | |
docker rmi $(docker image ls -q --filter "reference=debian*") | |
docker rmi $(docker image ls -q --filter "reference=alpine*") | |
docker rmi $(docker image ls -q --filter "reference=ubuntu:20.04") | |
- name: Disk size analyze AFTER | |
if: ${{ always() }} | |
run: | | |
set -eux | |
df -hl | |
- name: Checkout from repository | |
uses: actions/[email protected] | |
- uses: docker/metadata-action@v5 | |
id: meta | |
with: | |
images: ghcr.io/naa0yama/join_logo_scp_trial | |
flavor: | | |
latest=false | |
suffix=-${{ matrix.type }} | |
tags: | | |
type=ref,event=tag,prefix=,enable=true | |
# minimal (short sha) | |
type=sha,enable=true,prefix=,format=short | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: Dockerfile.${{ matrix.type }} | |
push: ${{ contains( github.event.pull_request.merged, true ) || inputs.rebuild == 'true' }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
no-cache: ${{ inputs.no-cache == true }} |