Skip to content

docker for #118

docker for #118 #38

Workflow file for this run

name: Build, Test, and Push Docker Image
on:
push:
branches:
- "dev-ci"
pull_request:
branches: [ "master" ]
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-test-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/dev-ci' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
load: true
- name: Run 'runff' Test Script on the built image
run: |
# The 'tags' output is a multi-line string of all generated tags.
# We'll grab the first tag from the list to use for our test.
TEST_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n 1)
echo "Testing image with tag: $TEST_TAG"
docker run --rm $TEST_TAG bash -c "cd tests/runff && bash ff-run.bash"