Skip to content

Commit 7cb8c6f

Browse files
committed
Update build-push workflow
1 parent a4ba5a2 commit 7cb8c6f

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

.github/workflows/build-push.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# Panubo build and push to Quay.io and ECR Public
2+
# This GH Action is intended for public docker images that package upstream applications/services (ie not for projects of Panubo's).
3+
# For repos that build multiple repos use the multi-build-push.yml workflow.
4+
#
5+
# This workflow runs on pushes to "main", PRs (does not push) or matching git tags.
6+
# Image names are generated from the repository name, if "docker-" is part of the repository name it is removed from the docker image name.
7+
#
8+
# Additionally this workflow performs some automated testing after a docker build.
9+
# Automated testing is triggered by `make _ci_test`, if no test is required the Makefile target should just run `true`.
10+
# Before tests are run a Docker build is performed, the resulting image has a tag of "test"
11+
# BATS is installed since it is commonly required by the tests.
12+
113
name: build and push on main and tags
214

315
on:
@@ -74,10 +86,10 @@ jobs:
7486
username: ${{ secrets.PANUBUILD_QUAYIO_USERNAME }}
7587
password: ${{ secrets.PANUBUILD_QUAYIO_TOKEN }}
7688

77-
# - name: Setup BATS
78-
# uses: mig4/setup-bats@v1
79-
# with:
80-
# bats-version: 1.7.0
89+
- name: Setup BATS
90+
uses: mig4/setup-bats@v1
91+
with:
92+
bats-version: 1.7.0
8193

8294
- name: Build and export to Docker
8395
uses: docker/build-push-action@v4
@@ -87,9 +99,9 @@ jobs:
8799
load: true
88100
tags: ${{ steps.image_name.outputs.image_name }}:test
89101

90-
# - name: Test
91-
# run: |
92-
# make _ci_test
102+
- name: Test
103+
run: |
104+
make _ci_test
93105
94106
- name: Build and Push
95107
uses: docker/build-push-action@v3

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ build-with-cache:
1717
test:
1818
bats -r tests/
1919

20+
_ci_test:
21+
true
22+
2023
push:
2124
docker push $(IMAGE_NAME):$(TAG)
2225

0 commit comments

Comments
 (0)