Skip to content

ci

ci #157

Workflow file for this run

name: ci
on:
push:
branches:
- "main"
tags:
- "v*"
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
env:
IMAGE_NAME: ${{ github.repository }}
PLATFORMS: linux/amd64,linux/amd64/v2,linux/arm64
REGISTRY: ghcr.io
TEST_TAG: docker-compose
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and export to Docker for tests
uses: docker/build-push-action@v3
with:
load: true
tags: ${{ env.TEST_TAG }}
- name: Run tests using new image
run: ./test
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
flavor: latest=true
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ env.PLATFORMS }}
push: true
tags: ${{ steps.meta.outputs.tags }}