This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
chore: use 4-cores ubuntu runner #17
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: Docker Build | |
on: | |
push: | |
branches: | |
- v1.5_cuda-12.0_ubuntu-22.04 | |
env: | |
IMAGE: deepset/gpu-jupyter | |
BASE_TAG: v1.5_cuda-12.0_ubuntu-22.04_slim | |
SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | |
DOCKER_HUB_PUSH_USER: ${{ secrets.DC_DOCKER_HUB_PUSH_USER }} | |
DOCKER_HUB_PUSH_TOKEN: ${{ secrets.DC_DOCKER_HUB_PUSH_TOKEN }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest-4-cores | |
steps: | |
- name: Checkout | |
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b | |
- name: Generate Dockerfile | |
run: ./generate-Dockerfile.sh --slim | |
- name: Login to DockerHub | |
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | |
with: | |
username: ${{ env.DOCKER_HUB_PUSH_USER }} | |
password: ${{ env.DOCKER_HUB_PUSH_TOKEN }} | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 | |
- name: Docker metadata | |
id: metadata | |
uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a | |
with: | |
images: ${{ env.IMAGE }} | |
tags: | | |
type=raw,value=${{ env.BASE_TAG }}-${{ env.SHA }} | |
type=raw,value=${{ env.BASE_TAG }}-latest | |
- name: Build and push container image | |
uses: docker/build-push-action@c84f38281176d4c9cdb1626ffafcd6b3911b5d94 | |
with: | |
context: .build | |
builder: ${{ steps.buildx.outputs.name }} | |
tags: ${{ steps.metadata.outputs.tags }} | |
push: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |