-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (64 loc) · 2.4 KB
/
call-docker-build-web.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Build Web
on:
push:
tags:
- '*'
workflow_dispatch:
workflow_run:
workflows: ["Test"]
types: [completed]
jobs:
docker-build:
name: Docker Build
uses: dockersamples/.github/.github/workflows/reusable-docker-build.yaml@main
if: ${{ github.event.workflow_run.conclusion == 'success' }} &&
${{ github.event.workflow_run.head_branch == 'main' }}
permissions:
contents: read
packages: write # needed to push docker image to ghcr.io
pull-requests: write # needed to create and update comments in PRs
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: false
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: |
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={{is_default_branch}}
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
### 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,linux/arm64
### Create a PR comment with image tags and labels
### defaults to false
# comment-enable: false
## Example release pipeline trigger:
#
# TAG="v0.0.1"
# git tag "$TAG" -m "Release version: $TAG"
# git push origin --tags