Skip to content

Merge pull request #84 from button-inc/mk-ui-fix #110

Merge pull request #84 from button-inc/mk-ui-fix

Merge pull request #84 from button-inc/mk-ui-fix #110

name: Build and push images
on:
push:
branches:
- develop
jobs:
docker-build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: ghcr.io/button-inc/iot-system-prototype/app
context: .
dockerfile: app/Dockerfile
name: app
- image: ghcr.io/button-inc/iot-system-prototype/api
context: .
dockerfile: api/Dockerfile
name: api
build-args: |

Check failure on line 22 in .github/workflows/build-and-push.yaml

View workflow run for this annotation

GitHub Actions / Build and push images

Invalid workflow file

The workflow is not valid. .github/workflows/build-and-push.yaml (Line: 22, Col: 25): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.BB_TOKEN
"BB_TOKEN=${{ secrets.BB_TOKEN }}"
name: Build ${{ matrix.name }} docker image
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ matrix.image }}
tags: |
type=sha,format=long,prefix=
latest
type=ref,event=pr
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ matrix.name }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ matrix.name }}
- name: Build image
uses: docker/build-push-action@v3
with:
context: ${{ matrix.context }}
builder: ${{ steps.buildx.outputs.name }}
push: true
file: ${{ matrix.dockerfile }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache