Skip to content

Commit

Permalink
Add docker builder workflow (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Consek authored Jul 25, 2021
1 parent 368d86c commit b67ed6f
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/docker_builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and Publish docker images

on:
push:
branches:
- master
tags:
- 'v**'

jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
component: ["frontend", "proxy", "backend"]
dockerhub_repo: ["consek"]
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ matrix.dockerhub_repo }}/${{ matrix.component }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{raw}}
type=sha,format=long
latest
-
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: Build and push
uses: docker/build-push-action@v2
with:
context: ${{ matrix.component }}/.
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: ${{ matrix.dockerhub_repo }}/${{ matrix.component }}:sha-${{ github.sha }},${{ matrix.dockerhub_repo }}/${{ matrix.component }}:latest
cache-to: type=inline

0 comments on commit b67ed6f

Please sign in to comment.