Skip to content

Use container in ci #10

Use container in ci

Use container in ci #10

Workflow file for this run

name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
prepare-container:
runs-on: ubuntu-latest
steps:
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}-pr${{ github.event.pull_request.number }}
- uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build:
needs: prepare-container
runs-on: ubuntu-latest
container:
images: ghcr.io/${{ github.repository }}-pr${{ github.event.pull_request.number }}

Check failure on line 32 in .github/workflows/ci.yaml

View workflow run for this annotation

GitHub Actions / CI

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yaml (Line: 32, Col: 7): Unexpected value 'images' .github/workflows/ci.yaml (Line: 43, Col: 7): Unexpected value 'images'
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- run: make build
- run: make run args=-help
test:
needs: prepare-container
runs-on: ubuntu-latest
container:
images: ghcr.io/${{ github.repository }}-pr${{ github.event.pull_request.number }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- run: make test