mirror of
https://codeberg.org/gigirassy/riptide
synced 2026-08-30 15:27:38 +00:00
Add .forgejo/workflows/docker.yml
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
# .
|
||||
name: Build and Push Multi-Arch Container
|
||||
|
||||
env:
|
||||
REGISTRY_HOST: codeberg.org
|
||||
REGISTRY_REPO: gigirassy/riptide
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: self-hosted
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY_HOST }}
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASS }}
|
||||
|
||||
- name: Build image (export tar)
|
||||
run: |
|
||||
docker buildx build \
|
||||
--platform linux/amd64 \
|
||||
--output type=docker,dest=image.tar \
|
||||
-t local-image:scan \
|
||||
.
|
||||
|
||||
- name: Scan image with Grype
|
||||
run: |
|
||||
docker run --rm \
|
||||
-v $(pwd):/work \
|
||||
anchore/grype:latest \
|
||||
docker-archive:/work/image.tar \
|
||||
--fail-on high \
|
||||
-o table
|
||||
|
||||
- name: Build and push multi-arch image
|
||||
if: success()
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64, linux/arm64
|
||||
tags: |
|
||||
${{ env.REGISTRY_HOST }}/${{ env.REGISTRY_REPO }}:latest
|
||||
Reference in New Issue
Block a user