Skip to content

Add a docker section #1

Add a docker section

Add a docker section #1

Workflow file for this run

name: Docker
# Limit concurrent runs of this workflow within a single PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
push:
branches: [ "master" ]
tags: [ "*.*.*" ]
jobs:
docker:
strategy:
matrix:
target: [ easy-rider ]
runs-on: ubuntu-latest
steps:
steps:

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

View workflow run for this annotation

GitHub Actions / .github/workflows/docker.yml

Invalid workflow file

You have an error in your yaml syntax on line 22
- uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Run the Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2
- name: 🔨 Build image using nix
run: |
IMAGE_NAME=ghcr.io/${{github.repository_owner}}/${{matrix.target}}
echo "IMAGE_NAME=${IMAGE_NAME}" >> $GITHUB_ENV
nix build .#docker-${{ matrix.target }} && docker load < ./result
# Determine whether we are building a tag and if yes, set a VERSION_NAME
BUILDING_TAG=${{github.ref_type == 'tag'}}
[[ ${BUILDING_TAG} = true ]] && \
VERSION_NAME=${{github.ref_name}}
# Use 'FROM' instruction to use docker build with --label
echo "FROM ${{matrix.target}}" | docker build \
--label org.opencontainers.image.source=https://github.com/devnull/easy-rider \
--label org.opencontainers.image.licenses=Apache-2.0 \
--label org.opencontainers.image.created=$(date -Is) \
--label org.opencontainers.image.revision=${{github.sha}} \
--label org.opencontainers.image.version=${VERSION_NAME:-unstable} \
--tag ${IMAGE_NAME}:unstable -
docker tag ${IMAGE_NAME}:unstable ${IMAGE_NAME}:latest
docker images
docker inspect ${IMAGE_NAME}:unstable