This repository has been archived by the owner on Oct 18, 2023. It is now read-only.
Bump base image to use bullseye #21
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: Build and push docker image for branch or tag | |
on: | |
release: | |
types: [ released ] | |
push: | |
branches: ['**'] | |
jobs: | |
build-k8s-proxysql-cluster-container: | |
name: Build k8s-proxysql-cluster container | |
runs-on: ubuntu-latest | |
if: github.repository == 'ScientaNL/k8s-proxysql-cluster' | |
steps: | |
- name: Set Github environment variables | |
uses: ScientaNL/[email protected] | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: DockerHub Login | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_PUBLIC_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PUBLIC_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Build & push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
file: ./docker/k8s-proxysql-cluster.Dockerfile | |
context: ./docker/ | |
push: true | |
tags: scienta/k8s-proxysql-cluster:${{ github.event_name == 'push' && 'branch-' || '' }}${{env.GITHUB_REF_NAME_SLUG}} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |