Skip to content

Commit

Permalink
Update docker-build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
aneisch authored Jul 23, 2024
1 parent d045fd8 commit 0a482dc
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build, Assess Vulnerability, Push
name: Build, Assess Vulnerability, Push, Sign Image

on:
push:
Expand All @@ -13,7 +13,7 @@ env:
IMAGE_NAME: thermostat_api_server

jobs:
build_assess_push_amd64:
AMD64:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -59,25 +59,30 @@ jobs:
- name: Sign the container image
run: cosign sign --yes ghcr.io/aneisch/${{ env.IMAGE_NAME }}@${{ steps.push-step.outputs.digest }}

build_multiarch:
Multiarch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- 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: Log into Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@master
with:
context: .
file: ./Dockerfile
Expand All @@ -86,3 +91,9 @@ jobs:
platforms: linux/arm64/v8
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

- name: Install cosign
uses: sigstore/cosign-installer@main

- name: Sign the container image
run: cosign sign --yes ghcr.io/aneisch/${{ env.IMAGE_NAME }}@${{ steps.push-step.outputs.digest }}

0 comments on commit 0a482dc

Please sign in to comment.