Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Commit

Permalink
BDRK-3412: Add GitHub actions to build Docker images (#46)
Browse files Browse the repository at this point in the history
* BDRK-3412: Add GitHub actions to build Docker images

* Test workflow

* Test workflow

* Test workflow

* Test workflow

* Test workflow

* Update workflow
  • Loading branch information
tunguyen9889 authored Sep 8, 2021
1 parent 2eeb96f commit 84cb1e3
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 3 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/build_docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build Docker images
on:
push:
branches:
- master
tags:
- v*
paths:
- 'dockerfiles/**'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
repo: ["consul-backup-gcs", "eks-container-insights", "fluentd"]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to Quay
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v3
with:
images: quay.io/basisai/${{ matrix.repo }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./dockerfiles/${{ matrix.repo }}/
# platforms: linux/amd64,linux/arm64,linux/386
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
6 changes: 3 additions & 3 deletions dockerfiles/consul-backup-gcs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM google/cloud-sdk:251.0.0
FROM google/cloud-sdk:355.0.0

ARG ansible_version=2.8.1
ARG consul_version=1.5.1
ARG ansible_version=2.9.25
ARG consul_version=1.10.2

RUN set -xe \
&& apt-get update \
Expand Down

0 comments on commit 84cb1e3

Please sign in to comment.