-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (31 loc) · 1.07 KB
/
containers.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
on: [push, pull_request]
name: Build container images
jobs:
build-container:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- context: "."
name: "kvpair"
- context: "./gateway"
name: "gateway"
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "${{ matrix.context }}"
push: ${{ github.event_name != 'pull_request' }}
tags: "${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.name }}:latest"
cache-from: |
type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.name }}:cache
cache-to: |
type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.name }}:cache,mode=max,compression=zstd