changing image name defaults (#4)
This commit is contained in:
43
.github/workflows/call-local-docker-build.yaml
vendored
43
.github/workflows/call-local-docker-build.yaml
vendored
@@ -8,12 +8,10 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
# don't rebuild image if someone only edited unrelated files
|
||||
paths-ignore:
|
||||
- 'README.md'
|
||||
- '.github/linters/**'
|
||||
pull_request:
|
||||
# don't rebuild image if someone only edited unrelated files
|
||||
paths-ignore:
|
||||
- 'README.md'
|
||||
- '.github/linters/**'
|
||||
@@ -27,57 +25,20 @@ jobs:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write # needed to push docker image to ghcr.io
|
||||
pull-requests: write # needed to create and update comments in PRs
|
||||
packages: write
|
||||
pull-requests: write
|
||||
|
||||
secrets:
|
||||
|
||||
# Only needed if with:dockerhub-enable is true below
|
||||
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
|
||||
# Only needed if with:dockerhub-enable is true below
|
||||
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
with:
|
||||
|
||||
### REQUIRED
|
||||
### ENABLE ONE OR BOTH REGISTRIES
|
||||
### tell docker where to push.
|
||||
### NOTE if Docker Hub is set to true, you must set secrets above and also add account/repo/tags below
|
||||
dockerhub-enable: true
|
||||
ghcr-enable: true
|
||||
|
||||
### REQUIRED
|
||||
### A list of the account/repo names for docker build. List should match what's enabled above
|
||||
### defaults to:
|
||||
image-names: |
|
||||
${{ github.repository }}
|
||||
ghcr.io/${{ github.repository }}
|
||||
|
||||
### REQUIRED set rules for tagging images, based on special action syntax:
|
||||
### https://github.com/docker/metadata-action#tags-input
|
||||
### defaults to:
|
||||
tag-rules: |
|
||||
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
|
||||
type=ref,event=pr
|
||||
type=ref,event=branch
|
||||
type=semver,pattern={{version}}
|
||||
type=raw,value=gha-${{ github.run_id }}
|
||||
|
||||
### path to where docker should copy files into image
|
||||
### defaults to root of repository (.)
|
||||
# context: .
|
||||
|
||||
### Dockerfile alternate name. Default is Dockerfile (relative to context path)
|
||||
# file: Containerfile
|
||||
|
||||
### build stage to target, defaults to empty, which builds to last stage in Dockerfile
|
||||
# target:
|
||||
|
||||
### platforms to build for, defaults to linux/amd64
|
||||
### other options: linux/amd64,linux/arm64,linux/arm/v7
|
||||
# platforms: linux/amd64
|
||||
|
||||
### Create a PR comment with image tags and labels
|
||||
### defaults to false
|
||||
# comment-enable: false
|
||||
13
.github/workflows/reusable-docker-build.yaml
vendored
13
.github/workflows/reusable-docker-build.yaml
vendored
@@ -26,7 +26,7 @@ on:
|
||||
comment-enable:
|
||||
description: Create a PR comment with image tags and labels
|
||||
required: false
|
||||
default: false
|
||||
default: true
|
||||
type: boolean
|
||||
context:
|
||||
description: Docker context (path) to start build from
|
||||
@@ -47,11 +47,13 @@ on:
|
||||
type: string
|
||||
# common ones: linux/amd64,linux/arm64,linux/arm/v7
|
||||
default: linux/amd64
|
||||
# TODO: does this work in calling repos?
|
||||
image-names:
|
||||
description: A list of the account/repo names for docker build
|
||||
required: true
|
||||
required: false
|
||||
type: string
|
||||
default: |
|
||||
${{ github.repository }}
|
||||
ghcr.io/${{ github.repository }}
|
||||
tag-rules:
|
||||
# https://github.com/marketplace/actions/docker-metadata-action#tags-input
|
||||
description: Use docker-metadata action to create tags from a key-value pair list in CSV format
|
||||
@@ -80,9 +82,6 @@ on:
|
||||
required: false
|
||||
|
||||
outputs:
|
||||
image-tags:
|
||||
description: "all tags from docker build"
|
||||
value: ${{ jobs.build-image.outputs.image-tags }}
|
||||
ghcr-tag:
|
||||
description: "single-use tag for ghcr.io"
|
||||
value: ${{ jobs.build-image.outputs.ghcr-tag }}
|
||||
@@ -105,8 +104,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
# all tags from docker build
|
||||
image-tags: ${{ steps.docker_meta.outputs.tags }}
|
||||
# only outputs the unique gha- image tag that's unique to each build
|
||||
ghcr-tag: ${{ steps.ghcr-tag.outputs.tag }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user