Skip to content

ci: add all platforms to release and docker workflows #27

ci: add all platforms to release and docker workflows

ci: add all platforms to release and docker workflows #27

Workflow file for this run

name: docker images
on:
push:
branches:
- main
- master
paths:
- 'neutrino_server/**'
- '.github/workflows/docker.yaml'
pull_request:
branches:
- main
- master
paths:
- 'neutrino_server/**'
- '.github/workflows/docker.yaml'
release:
types: [published]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
test:
uses: ./.github/workflows/test.yaml
pre-commit:
uses: ./.github/workflows/pre-commit.yaml
build-and-push:
runs-on: ubuntu-latest
needs: [test, pre-commit]
# Only push images on push to main/master or releases, not on PRs
if: github.event_name != 'pull_request'
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to Container registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@v7
with:
context: ./neutrino_server
file: ./neutrino_server/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6