Skip to content

refactor(graph): use project package for dependency resolution #84

refactor(graph): use project package for dependency resolution

refactor(graph): use project package for dependency resolution #84

Workflow file for this run

---
name: 🐳 Docker Build & Push
on:
push:
branches: ["main"]
tags: ["v*.*.*"]
pull_request:
branches: ["main"]
permissions:
contents: read
packages: write
security-events: write
actions: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
REGISTRY: ghcr.io
GO_VERSION: "1.24.5"
jobs:
docker:
name: 🐳 Build & Push Docker Image
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os:
- alpine
- rocky-8
- rocky-9
- rocky-10
- ubuntu-focal
- ubuntu-jammy
- ubuntu-noble
steps:
- name: 📂 Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: 🔍 Lint Dockerfile
uses: hadolint/hadolint-action@v3.2.0
with:
dockerfile: build/deploy/${{ matrix.os }}/Dockerfile
config: .hadolint.yml
output-file: hadolint-${{ matrix.os }}.sarif
format: sarif
- name: 📋 Upload Hadolint results
if: always()
continue-on-error: true
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: hadolint-${{ matrix.os }}.sarif
wait-for-processing: true
category: hadolint-${{ matrix.os }}
- name: 🐳 Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: 🔐 Log in to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🔐 Log in to Docker Hub
if: github.event_name != 'pull_request'
continue-on-error: true
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: 📋 Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ github.repository }}-${{ matrix.os }}
labels: |
maintainer=M0Rf30
org.opencontainers.image.authors=M0Rf30
org.opencontainers.image.title=yap-${{ matrix.os }}
org.opencontainers.image.description=YAP - Yet Another Packager for
${{ matrix.os }}
org.opencontainers.image.vendor=M0Rf30
tags: |
type=ref,event=branch
type=ref,event=pr
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: 🔨 Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: build/deploy/${{ matrix.os }}/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
GO_VERSION=${{ env.GO_VERSION }}
VERSION=${{ github.ref_name }}
BUILD_TIME=${{ github.run_id }}
COMMIT=${{ github.sha }}
- name: 📝 Output image details
run: |
{
echo "## 🐳 Docker Image Built"
echo ""
echo "**OS:** ${{ matrix.os }}"
echo "**Tags:** ${{ steps.meta.outputs.tags }}"
echo "**Labels:** ${{ steps.meta.outputs.labels }}"
} >> "$GITHUB_STEP_SUMMARY"