manual-build-push-release #7
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: manual-build-push-release | |
on: | |
workflow_dispatch: | |
inputs: | |
tag_version: | |
description: 'Docker Image Tag' | |
required: true | |
default: '' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: false | |
android: true | |
dotnet: true | |
haskell: true | |
large-packages: true | |
docker-images: true | |
swap-storage: true | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Tag Version | |
run: echo ${{ github.event.inputs.tag_version }} | |
- | |
name: Write Tag to ENV variable | |
run: echo "LABEL_VERSION=${{ github.event.inputs.tag_version }}" >> $GITHUB_ENV | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME_COMMUNITY }} | |
password: ${{ secrets.DOCKER_TOKEN_COMMUNITY }} | |
- | |
name: Login to Docker Supervisely Enterprise | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ secrets.DOCKER_ENTERPRISE_REGISTRY }} | |
username: ${{ secrets.DOCKER_USERNAME_ENTERPRISE }} | |
password: ${{ secrets.DOCKER_PASSWORD_ENTERPRISE }} | |
# - | |
# name: Login to Docker Supervisely Developer | |
# uses: docker/login-action@v3 | |
# with: | |
# registry: ${{ secrets.DOCKER_DEVELOPER_REGISTRY }} | |
# username: ${{ secrets.DOCKER_USERNAME_DEVELOPER }} | |
# password: ${{ secrets.DOCKER_PASSWORD_DEVELOPER }} | |
- | |
name: Get Docker Labels from python script | |
run: python .github/workflows/docker_labels.py | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
version: v0.9.1 | |
- | |
name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./ | |
file: ./Dockerfile | |
provenance: false | |
builder: ${{ steps.buildx.outputs.name }} | |
push: true | |
tags: | | |
supervisely/agent:${{ env.LABEL_VERSION }} | |
${{ secrets.DOCKER_ENTERPRISE_REGISTRY }}/rc2/agent:${{ env.LABEL_VERSION }} | |
${{ secrets.DOCKER_DEVELOPER_REGISTRY }}/supervisely/five/agent:${{ env.LABEL_VERSION }} | |
build-args: | | |
LABEL_VERSION=agent:${{ env.LABEL_VERSION }} | |
LABEL_INFO=${{ env.LABEL_INFO }} | |
LABEL_MODES=${{ env.LABEL_MODES }} | |
LABEL_README=${{ env.LABEL_README }} | |
LABEL_BUILT_AT=${{ env.LABEL_BUILT_AT }} | |
cache-from: type=registry,ref=supervisely/agent:cache | |
cache-to: type=registry,ref=supervisely/agent:cache,mode=max |