Skip to content

github action

github action #1

Workflow file for this run

name: Docker
on:
push:
branches:
- main
tags:
- "v*.*.*"
pull_request:
jobs:
docker:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
fail-fast: false
matrix:
name:
- cdrhook
- uploader
- monitor
include:
- name: cdrhook
FOLDER: server
PLATFORM: "linux/amd64,linux/arm64"
IMAGE: criticalmaas-cdr
- name: uploader
FOLDER: uploader
PLATFORM: "linux/amd64,linux/arm64"
IMAGE: criticalmaas-uploader
- name: monitor
FOLDER: monitor
PLATFORM: "linux/amd64,linux/arm64"
IMAGE: criticalmaas-monitor
steps:
- uses: actions/checkout@v4
# create metadata for image
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
ncsa/${{ matrix.IMAGE }}
ghcr.io/${{ github.repository_owner }}/${{ matrix.IMAGE }}
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
# setup docker build
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Inspect Builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
# login to registries
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
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 }}
# build the docker images
- name: Build and push ${{ matrix.name }}
uses: docker/build-push-action@v5
with:
push: {{ github.event_name != 'pull_request' }}

Check failure on line 94 in .github/workflows/docker.yml

View workflow run for this annotation

GitHub Actions / Docker

Invalid workflow file

The workflow is not valid. .github/workflows/docker.yml (Line: 94, Col: 17): A mapping was not expected
context: ${{ matrix.FOLDER }}
platforms: ${{ matrix.PLATFORM }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}