Skip to content

[chore][resoto] Bump Libs (#1779) #2114

[chore][resoto] Bump Libs (#1779)

[chore][resoto] Bump Libs (#1779) #2114

Workflow file for this run

name: Build Docker Images
on:
push:
tags:
- "*.*.*"
branches:
- main
pull_request:
paths:
- "Dockerfile*"
- "docker/**"
- "dockerV2/**"
- ".github/workflows/docker-build.yml"
- "requirements-all.txt"
workflow_dispatch:
jobs:
split-build:
name: "Build split Docker images" # Do not rename without updating workflow defined in publish.yml
runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 1024
swap-size-mb: 20000
overprovision-lvm: 'true'
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-docker-images: 'true'
remove-codeql: 'true'
- name: Check out repository
uses: actions/checkout@v3
- name: Check free space before build
run: |
echo "Free space:"
df -h
- name: Get short commit SHA
id: sha
run: echo "short=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
- name: Set build platforms
id: platform
run: |
GITHUB_REF="${{ github.ref }}"
GITHUB_TAG=${GITHUB_REF##*/}
if [ "${{ github.ref_type }}" = tag ]; then
echo "targets=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
echo "uitag=latest" >> $GITHUB_OUTPUT
if [[ "$GITHUB_TAG" =~ [0-9]([ab]|rc)[0-9]* ]]; then
echo "latest=false" >> $GITHUB_OUTPUT
else
echo "latest=true" >> $GITHUB_OUTPUT
fi
else
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "targets=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
else
echo "targets=linux/amd64" >> $GITHUB_OUTPUT
fi
echo "uitag=edge" >> $GITHUB_OUTPUT
echo "latest=false" >> $GITHUB_OUTPUT
fi
- name: Check short commit SHA and build targets
run: |
echo ${{ steps.sha.outputs.short }}
echo ${{ steps.platform.outputs.targets }}
echo ${{ steps.platform.outputs.uitag }}
echo ${{ steps.platform.outputs.latest }}
- name: Docker resotobase meta
id: basemeta
uses: docker/metadata-action@v4
with:
images: |
someengineering/resotobase
ghcr.io/someengineering/resotobase
flavor: |
latest=${{ steps.platform.outputs.latest }}
tags: |
type=pep440,pattern={{version}}
type=pep440,pattern={{major}}.{{minor}}
type=pep440,pattern={{major}}
type=sha,prefix=
type=edge
labels: |
org.opencontainers.image.title=resotobase
org.opencontainers.image.description=Resoto base image
org.opencontainers.image.vendor=Some Engineering Inc.
- name: Docker resotocore meta
if: github.event_name != 'pull_request'
id: coremeta
uses: docker/metadata-action@v4
with:
images: |
someengineering/resotocore
ghcr.io/someengineering/resotocore
flavor: |
latest=${{ steps.platform.outputs.latest }}
tags: |
type=pep440,pattern={{version}}
type=pep440,pattern={{major}}.{{minor}}
type=pep440,pattern={{major}}
type=sha,prefix=
type=edge
labels: |
org.opencontainers.image.title=resotocore
org.opencontainers.image.description=Resoto Core
org.opencontainers.image.vendor=Some Engineering Inc.
- name: Docker resotoworker meta
if: github.event_name != 'pull_request'
id: workermeta
uses: docker/metadata-action@v4
with:
images: |
someengineering/resotoworker
ghcr.io/someengineering/resotoworker
flavor: |
latest=${{ steps.platform.outputs.latest }}
tags: |
type=pep440,pattern={{version}}
type=pep440,pattern={{major}}.{{minor}}
type=pep440,pattern={{major}}
type=sha,prefix=
type=edge
labels: |
org.opencontainers.image.title=resotoworker
org.opencontainers.image.description=Resoto Worker
org.opencontainers.image.vendor=Some Engineering Inc.
- name: Docker resotometrics meta
if: github.event_name != 'pull_request'
id: metricsmeta
uses: docker/metadata-action@v4
with:
images: |
someengineering/resotometrics
ghcr.io/someengineering/resotometrics
flavor: |
latest=${{ steps.platform.outputs.latest }}
tags: |
type=pep440,pattern={{version}}
type=pep440,pattern={{major}}.{{minor}}
type=pep440,pattern={{major}}
type=sha,prefix=
type=edge
labels: |
org.opencontainers.image.title=resotometrics
org.opencontainers.image.description=Resoto Metrics
org.opencontainers.image.vendor=Some Engineering Inc.
- name: Docker resotoshell meta
if: github.event_name != 'pull_request'
id: shellmeta
uses: docker/metadata-action@v4
with:
images: |
someengineering/resotoshell
someengineering/resh
ghcr.io/someengineering/resotoshell
ghcr.io/someengineering/resh
flavor: |
latest=${{ steps.platform.outputs.latest }}
tags: |
type=pep440,pattern={{version}}
type=pep440,pattern={{major}}.{{minor}}
type=pep440,pattern={{major}}
type=sha,prefix=
type=edge
labels: |
org.opencontainers.image.title=resotoshell
org.opencontainers.image.description=Resoto Shell (resh)
org.opencontainers.image.vendor=Some Engineering Inc.
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v2
with:
platforms: arm64,amd64
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
- name: Log in to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push resotobase Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile.resotobase
platforms: ${{ steps.platform.outputs.targets }}
push: ${{ github.event_name != 'pull_request' }}
build-args: |
UI_IMAGE_TAG=${{ steps.platform.outputs.uitag }}
SOURCE_COMMIT=${{ github.sha }}
TESTS=false
tags: ${{ steps.basemeta.outputs.tags }}
labels: ${{ steps.basemeta.outputs.labels }}
provenance: false # Temporary workaround for https://github.com/docker/buildx/issues/1533
- name: Build and push resotocore Docker image
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile.resotocore
platforms: ${{ steps.platform.outputs.targets }}
push: ${{ github.event_name != 'pull_request' }}
build-args: |
IMAGE_TAG=${{ steps.sha.outputs.short }}
tags: ${{ steps.coremeta.outputs.tags }}
labels: ${{ steps.coremeta.outputs.labels }}
provenance: false # Temporary workaround for https://github.com/docker/buildx/issues/1533
- name: Build and push resotoworker Docker image
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile.resotoworker
platforms: ${{ steps.platform.outputs.targets }}
push: ${{ github.event_name != 'pull_request' }}
build-args: |
IMAGE_TAG=${{ steps.sha.outputs.short }}
tags: ${{ steps.workermeta.outputs.tags }}
labels: ${{ steps.workermeta.outputs.labels }}
provenance: false # Temporary workaround for https://github.com/docker/buildx/issues/1533
- name: Build and push resotometrics Docker image
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile.resotometrics
platforms: ${{ steps.platform.outputs.targets }}
push: ${{ github.event_name != 'pull_request' }}
build-args: |
IMAGE_TAG=${{ steps.sha.outputs.short }}
tags: ${{ steps.metricsmeta.outputs.tags }}
labels: ${{ steps.metricsmeta.outputs.labels }}
provenance: false # Temporary workaround for https://github.com/docker/buildx/issues/1533
- name: Build and push resotoshell Docker image
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile.resotoshell
platforms: ${{ steps.platform.outputs.targets }}
push: ${{ github.event_name != 'pull_request' }}
build-args: |
IMAGE_TAG=${{ steps.sha.outputs.short }}
tags: ${{ steps.shellmeta.outputs.tags }}
labels: ${{ steps.shellmeta.outputs.labels }}
provenance: false # Temporary workaround for https://github.com/docker/buildx/issues/1533
- name: Check free space after build
run: |
echo "Free space:"
df -h