You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+50-46Lines changed: 50 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,8 @@ as a high-level build command.
14
14
___
15
15
16
16
*[Usage](#usage)
17
-
*[Path context](#path-context)
18
17
*[Git context](#git-context)
18
+
*[Path context](#path-context)
19
19
*[Summaries](#summaries)
20
20
*[Customizing](#customizing)
21
21
*[inputs](#inputs)
@@ -27,57 +27,22 @@ ___
27
27
28
28
## Usage
29
29
30
-
### Path context
31
-
32
-
By default, this action will use the local bake definition (`source: .`), so
33
-
you need to use the [`actions/checkout`](https://github.com/actions/checkout/)
34
-
action to check out the repository.
35
-
36
-
```yaml
37
-
name: ci
38
-
39
-
on:
40
-
push:
41
-
branches:
42
-
- 'master'
43
-
44
-
jobs:
45
-
bake:
46
-
runs-on: ubuntu-latest
47
-
steps:
48
-
-
49
-
name: Checkout
50
-
uses: actions/checkout@v4
51
-
-
52
-
name: Login to DockerHub
53
-
uses: docker/login-action@v3
54
-
with:
55
-
username: ${{ vars.DOCKERHUB_USERNAME }}
56
-
password: ${{ secrets.DOCKERHUB_TOKEN }}
57
-
-
58
-
name: Set up Docker Buildx
59
-
uses: docker/setup-buildx-action@v3
60
-
-
61
-
name: Build and push
62
-
uses: docker/bake-action@v5
63
-
with:
64
-
push: true
65
-
```
66
-
67
30
### Git context
68
31
69
-
Git context can be provided using the [`source` input](#inputs). This means
70
-
that you don't need to use the [`actions/checkout`](https://github.com/actions/checkout/)
32
+
Since `v6` this action uses the [Git context](https://docs.docker.com/build/bake/remote-definition/)
33
+
to build from a remote bake definition by default like the [build-push-action](https://github.com/docker/build-push-action)
34
+
does. This means that you don't need to use the [`actions/checkout`](https://github.com/actions/checkout/)
71
35
action to check out the repository as [BuildKit](https://docs.docker.com/build/buildkit/)
72
36
will do this directly.
73
37
38
+
The git reference will be based on the [event that triggered your workflow](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows)
39
+
and will result in the following context: `https://github.com/<owner>/<repo>.git#<ref>`.
Be careful because **any file mutation in the steps that precede the build step
104
70
will be ignored, including processing of the `.dockerignore` file** since
105
71
the context is based on the Git reference. However, you can use the
106
-
[Path context](#path-context) alongside the [`actions/checkout`](https://github.com/actions/checkout/)
107
-
action to remove this restriction.
72
+
[Path context](#path-context) using the [`source` input](#inputs) alongside
73
+
the [`actions/checkout`](https://github.com/actions/checkout/) action to remove
74
+
this restriction.
108
75
109
76
Default Git context can also be provided using the [Handlebars template](https://handlebarsjs.com/guide/)
110
77
expression `{{defaultContext}}`. Here we can use it to provide a subdirectory
@@ -117,6 +84,8 @@ to the default Git context:
117
84
with:
118
85
source: "{{defaultContext}}:mysubdir"
119
86
push: true
87
+
set: |
88
+
*.tags=user/app:latest
120
89
```
121
90
122
91
Building from the current repository automatically uses the `GITHUB_TOKEN`
@@ -133,12 +102,47 @@ another private repository for remote definitions, you can set the
This action generates a [job summary](https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/)
0 commit comments