Skip to content

fix: Moved to registry cache type over gha #3

fix: Moved to registry cache type over gha

fix: Moved to registry cache type over gha #3

Workflow file for this run

name: Release
on:
push:
branches:
- 'main'
tags:
- "v*"
pull_request:
branches:
- 'main'
jobs:
release-images:
runs-on: ubuntu-latest
strategy:
matrix:
image: ["mininet", "ryu"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Container Metadata
id: metadata
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}
flavor: |
latest=auto
prefix=
suffix=
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: ./${{ matrix.image }}
file: ./${{ matrix.image }}/Dockerfile
platforms: linux/amd64, linux/arm64/v8
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:buildcache,mode=max