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
## Automate your development workflows using Github Actions and Okteto Cloud
4
+
4
5
GitHub Actions gives you the flexibility to build an automated software development workflows. With GitHub Actions for Okteto Cloud you can create workflows to build, deploy and update your applications in [Okteto Cloud](https://cloud.okteto.com).
5
6
6
7
Get started today with a [free Okteto Cloud account](https://cloud.okteto.com)!
@@ -11,20 +12,47 @@ You can use this action to build images from an [Okteto Manifest](https://www.ok
11
12
12
13
## Inputs
13
14
15
+
### `tag`
16
+
17
+
Name and optionally a tag in the `name:tag` format for the build. When `file` points to a `Dockerfile`, in order to push the image to a registry, a `tag` is required. Otherwise, the build would be done but no image will be pushed to the registry.
18
+
14
19
### `file`
15
20
16
-
The path to the Okteto Manifest. Default `"okteto.yml"`.
17
-
Name of the Dockerfile. Default `"Dockerfile"`.
21
+
The relative path to the Okteto Manifest.
22
+
23
+
> You can also use this input to point to a Dockerfile. In this mode, okteto build will ignore your Okteto manifest, and directly build the image defined in the Dockerfile. Use this to build images that are not defined on your Okteto manifest.
24
+
25
+
### `path`
26
+
27
+
Service from the Okteto Manifest to build. You can select the service to build providing the `path`, otherwise all images at the Okteto Manifest build definition would be build.
28
+
29
+
When repository does not have an Okteto Manifest or `Dockerfile` is provided at `file`, `path` is the execution path of the action. .
30
+
31
+
### `buildargs`
18
32
19
-
### `global`
33
+
A list of comma-separated build arguments.
20
34
21
-
When true will make the image available to everyone in your team. Default `false`.
22
-
Only admins can push images to the global registry.
35
+
### `no-cache`
23
36
37
+
Set to "true" when no cache should be used when building the image
38
+
39
+
### `cache-from`
40
+
41
+
A list of comma-separated images where cache should be imported from.
42
+
43
+
### `export-cache`
44
+
45
+
A list of comma-separated images where cache should be exported to.
46
+
47
+
### `secrets`
48
+
49
+
A list of semi-colon secrets. Each with format: id=mysecret,src=/local/secret
24
50
25
51
## Example usage
26
52
27
-
This example runs the context action and then builds and pushes an image.
53
+
### Build and push images for all services described at an Okteto Manifest
54
+
55
+
This example runs the context action `okteto/context@latest` and then builds and pushes an image. A valid Okteto Manifest should exist at the repository.
28
56
29
57
```yaml
30
58
# File: .github/workflows/workflow.yml
@@ -33,48 +61,99 @@ on: [push]
33
61
name: example
34
62
35
63
jobs:
64
+
devflow:
65
+
runs-on: ubuntu-latest
66
+
steps:
67
+
- uses: okteto/context@latest
68
+
with:
69
+
token: ${{ secrets.OKTETO_TOKEN }}
70
+
71
+
- name: "Build"
72
+
uses: okteto/build@latest
73
+
```
74
+
75
+
### Build and push images for single service described in the Okteto Manifest
36
76
77
+
This example runs the context action `okteto/context@latest` and then builds and pushes the image for the service `service`. A valid Okteto Manifest should exist at the repository.
78
+
79
+
```yaml
80
+
# File: .github/workflows/workflow.yml
81
+
on: [push]
82
+
83
+
name: example
84
+
85
+
jobs:
37
86
devflow:
38
87
runs-on: ubuntu-latest
39
88
steps:
40
-
41
-
- uses: okteto/context@latest
42
-
with:
43
-
token: ${{ secrets.OKTETO_TOKEN }}
44
-
45
-
- name: "Build"
46
-
uses: okteto/build@latest
89
+
- name: "Context Setup"
90
+
uses: okteto/context@latest
91
+
with:
92
+
token: ${{ secrets.OKTETO_TOKEN }}
93
+
94
+
- name: "Build"
95
+
uses: okteto/build@latest
96
+
with:
97
+
path: service
47
98
```
48
99
100
+
### Build and push images that are not defined in your Okteto manifest.
101
+
102
+
This example sets the context, and then builds an image that is not defined in the Okteto Manifest.
103
+
104
+
```yaml
105
+
# File: .github/workflows/workflow.yml
106
+
on: [push]
107
+
108
+
name: example
109
+
110
+
jobs:
111
+
devflow:
112
+
runs-on: ubuntu-latest
113
+
steps:
114
+
- name: "Context Setup"
115
+
uses: okteto/context@latest
116
+
with:
117
+
token: ${{ secrets.OKTETO_TOKEN }}
118
+
119
+
- name: "Build"
120
+
uses: okteto/build@latest
121
+
with:
122
+
tag: myapp-backend:latest
123
+
file: Dockerfile
124
+
path: backend
125
+
```
126
+
127
+
If `tag` is not provided, the image won't be pushed to the registry.
128
+
49
129
## Advanced usage
50
130
51
-
### Custom Certification Authorities or Self-signed certificates
131
+
### Custom Certification Authorities or Self-signed certificates
52
132
53
-
You can specify a custom certificate authority or a self-signed certificate by setting the `OKTETO_CA_CERT` environment variable. When this variable is set, the action will install the certificate in the container, and then execute the action.
133
+
You can specify a custom certificate authority or a self-signed certificate by setting the `OKTETO_CA_CERT` environment variable. When this variable is set, the action will install the certificate in the container, and then execute the action.
54
134
55
-
Use this option if you're using a private Certificate Authority or a self-signed certificate in your [Okteto Enterprise](http://okteto.com/enterprise) instance. We recommend that you store the certificate as an [encrypted secret](https://docs.github.com/en/actions/reference/encrypted-secrets), and that you define the environment variable for the entire job, instead of doing it on every step.
135
+
Use this option if you're using a private Certificate Authority or a self-signed certificate in your [Okteto Enterprise](http://okteto.com/enterprise) instance. We recommend that you store the certificate as an [encrypted secret](https://docs.github.com/en/actions/reference/encrypted-secrets), and that you define the environment variable for the entire job, instead of doing it on every step.
0 commit comments