Skip to content

CI

CI #7

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0" # Weekly on Sundays at midnight
jobs:
build-and-push:
strategy:
matrix:
concurrently-version: [9.x]
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@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
${{ github.ref == 'refs/heads/main' && github.repository || '' }}
tags: |
type=raw,value=${{ matrix.concurrently-version }},enable=${{ github.ref == 'refs/heads/main' }}
type=sha,prefix=${{ matrix.concurrently-version }}-
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: |
linux/amd64
linux/arm64
pull: true
push: ${{ github.ref == 'refs/heads/main' }}
build-args: |
CONCURRENTLY_VERSION=${{ matrix.concurrently-version }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max