Skip to content
Snippets Groups Projects
Commit dedad207 authored by Austin Anderson's avatar Austin Anderson
Browse files

Add a workflow for handling branch-specific containers, if needed

parent 0f3df626
Branches
No related tags found
No related merge requests found
name: Upload docker containers modified for release branches
on:
workflow_dispatch:
push:
paths:
- '.github/workflows/docker.yml'
- 'tf_sig_build_dockerfiles/**'
- '!tf_sig_build_dockerfiles/README.md'
branches:
# Branch should match the TF branch name
- "r[1-9].[0-9]+"
jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [python3.7, python3.8, python3.9, python3.10]
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GCR
uses: docker/login-action@v1
with:
registry: gcr.io
username: _json_key
password: ${{ secrets.GCP_CREDS }}
-
name: Generate variables for cache busting and tag naming
run: |
echo "::set-output name=DATE::$(date +'%Y-%m-%d')"
# Converts r2.9 to just 2.9
echo "::set-output name=REF::$(echo $GITHUB_REF_NAME | sed 's/r//g')"
id: vars
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
context: ./tf_sig_build_dockerfiles
target: devel
build-args: |
PYTHON_VERSION=${{ matrix.python-version }}
CACHEBUSTER=${{ steps.vars.outputs.DATE }}
tags: |
tensorflow/build:${{ steps.vars.outputs.REF }}-${{ matrix.python-version }}
gcr.io/tensorflow-sigs/build:${{ steps.vars.outputs.REF }}-${{ matrix.python-version }}
cache-from: type=registry,ref=tensorflow/build:${{ steps.vars.outputs.REF }}-${{ matrix.python-version }}
cache-to: type=inline
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment