Skip to content

fix: Use apt-get

fix: Use apt-get #516

name: build-and-push
on:
workflow_dispatch:
pull_request:
paths-ignore:
- "**/README.md"
schedule:
- cron: "0 0 * * *"
push:
branches:
- master
paths-ignore:
- "**/README.md"
jobs:
build-and-push:
name: Build and push image to ghcr
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
image:
- fedora
- ubuntu
release:
- latest
include:
- release: 40
image: fedora
- release: 24.04
image: ubuntu
env:
IMAGE_NAME: ${{ matrix.image }}
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
IMAGE_RELEASE: ${{ matrix.release }}
steps:
- uses: actions/checkout@v4
- name: Login to registry
uses: docker/[email protected]
with:
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ env.IMAGE_RELEASE }}
- name: Build and push Docker image
uses: docker/[email protected]
with:
build-args: |
IMAGE_RELEASE=${{ env.IMAGE_RELEASE }}
file: ./${{ env.IMAGE_NAME }}/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}