Skip to content

Commit

Permalink
CI: test the image built in this action
Browse files Browse the repository at this point in the history
  • Loading branch information
tarleb committed Jun 10, 2024
1 parent 30eaf88 commit 1b4eef5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Image Builder

on:
push: {}
push:
# branch: main

jobs:
# Build images and push them
Expand Down Expand Up @@ -36,16 +37,18 @@ jobs:
ghcr.io/openjournals/inara
tags: |
type=semver,pattern={{version}}
type=edge,branch=main
type=edge
- name: Build and push image
- name: Build and maybe push image
id: push
uses: docker/build-push-action@v5
with:
context: '.'
push: true
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Test image
run: make test
- name: Placeholder task
run: make tags TAGS=${{ steps.meta.outputs.tags }}
# - name: Test image
# run: make test TAGS=${{ steps.meta.outputs.tags }}
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ TARGET_FOLDER = publishing-artifacts

ARTICLE_INFO_FILE = $(OPENJOURNALS_PATH)/default-article-info.yaml

TAGS = openjournals/inara:edge
IMAGE = $(shell printf "$(TAGS)" | head -n1)

tags:
echo $(TAGS)

.PHONY: all
all: cff pdf html jats crossref native preprint

Expand Down Expand Up @@ -48,7 +54,7 @@ $(TARGET_FOLDER):

.PHONY: docker-image
docker-image: Dockerfile
docker build --tag openjournals/inara:edge .
docker build --tag $(IMAGE) .

push-docker-image:
docker push openjournals/inara
Expand Down Expand Up @@ -92,7 +98,7 @@ clean:
INARA_TEST_CMD = docker run --rm \
--user $(shell id -u):$(shell id -g) \
--env SOURCE_DATE_EPOCH=1234567890 \
-v $${PWD}:/data openjournals/inara:edge
-v $${PWD}:/data $(IMAGE)

.PHONY: test test-golden-draft test-golden-pub
test: test-golden-draft test-golden-pub
Expand Down

0 comments on commit 1b4eef5

Please sign in to comment.