# Okteto github action

**URL:** <https://community.okteto.com/t/okteto-github-action/301>\
**Category:** Help\
**Created:** [October 22, 2022, 2:07pm UTC](https://community.okteto.com/t/okteto-github-action/301 "2022-10-22T14:07:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfvitale](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/mfvitale/32/192_2.png) [@mfvitale](https://community.okteto.com/u/mfvitale)\
**Post date:** [October 22, 2022, 2:07pm UTC](https://community.okteto.com/t/okteto-github-action/301/1 "2022-10-22T14:07:12Z")

</div>

Hi,  
I followed the guide

but I got his error on the build step

> Run okteto/actions/build@v3.1  
> /usr/bin/docker run --name d558139da6372d19a4a5c8e6b14c5ea1516b7\_fc283a --label 8d5581 --workdir /github/workspace --rm -e “IMAGE\_TAG” -e “IMAGE\_NAME” -e “INPUT\_TOKEN” -e “INPUT\_TAG” -e “INPUT\_FILE” -e “INPUT\_PATH” -e “INPUT\_BUILDARGS” -e “HOME” -e “GITHUB\_JOB” -e “GITHUB\_REF” -e “GITHUB\_SHA” -e “GITHUB\_REPOSITORY” -e “GITHUB\_REPOSITORY\_OWNER” -e “GITHUB\_RUN\_ID” -e “GITHUB\_RUN\_NUMBER” -e “GITHUB\_RETENTION\_DAYS” -e “GITHUB\_RUN\_ATTEMPT” -e “GITHUB\_ACTOR” -e “GITHUB\_TRIGGERING\_ACTOR” -e “GITHUB\_WORKFLOW” -e “GITHUB\_HEAD\_REF” -e “GITHUB\_BASE\_REF” -e “GITHUB\_EVENT\_NAME” -e “GITHUB\_SERVER\_URL” -e “GITHUB\_API\_URL” -e “GITHUB\_GRAPHQL\_URL” -e “GITHUB\_REF\_NAME” -e “GITHUB\_REF\_PROTECTED” -e “GITHUB\_REF\_TYPE” -e “GITHUB\_WORKSPACE” -e “GITHUB\_ACTION” -e “GITHUB\_EVENT\_PATH” -e “GITHUB\_ACTION\_REPOSITORY” -e “GITHUB\_ACTION\_REF” -e “GITHUB\_PATH” -e “GITHUB\_ENV” -e “GITHUB\_STEP\_SUMMARY” -e “GITHUB\_STATE” -e “GITHUB\_OUTPUT” -e “RUNNER\_OS” -e “RUNNER\_ARCH” -e “RUNNER\_NAME” -e “RUNNER\_TOOL\_CACHE” -e “RUNNER\_TEMP” -e “RUNNER\_WORKSPACE” -e “ACTIONS\_RUNTIME\_URL” -e “ACTIONS\_RUNTIME\_TOKEN” -e “ACTIONS\_CACHE\_URL” -e GITHUB\_ACTIONS=true -e CI=true -v “/var/run/docker.sock”:“/var/run/docker.sock” -v “/home/runner/work/\_temp/\_github\_home”:“/github/home” -v “/home/runner/work/\_temp/\_github\_workflow”:“/github/workflow” -v “/home/runner/work/\_temp/\_runner\_file\_commands”:“/github/file\_commands” -v “/home/runner/work/curto/curto”:“/github/workspace” 8d5581:39da6372d19a4a5c8e6b14c5ea1516b7 “_ **" "** _/curto:478db246abdb49ee4f2d61e290ec56980fa8da87” “Dockerfile” “.” “”  
> ✓ Logged in as \*\*\*  
> Run `okteto namespace` to switch your context and download your Kubernetes credentials.  
> -t \*\*\*/curto:478db246abdb49ee4f2d61e290ec56980fa8da87 -f Dockerfile .  
> i Running your build in Okteto Cloud…  
> x failed to create temporary build folder: open Dockerfile: no such file or directory

the Dockerfile is in the root of the repository. Any help?

Thanks,  
Mario.

---

<div class="post-metadata">

**Author:** ![ramiro](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/ramiro/32/6_2.png) [@ramiro](https://community.okteto.com/u/ramiro)\
**Post date:** [October 22, 2022, 5:48pm UTC](https://community.okteto.com/t/okteto-github-action/301/2 "2022-10-22T17:48:45Z")

</div>

Can you share the file with the github action definition?

PS welcome to our community @mfvitale !

---

<div class="post-metadata">

**Author:** ![mfvitale](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/mfvitale/32/192_2.png) [@mfvitale](https://community.okteto.com/u/mfvitale)\
**Post date:** [October 22, 2022, 6:00pm UTC](https://community.okteto.com/t/okteto-github-action/301/3 "2022-10-22T18:00:41Z")

</div>

Thank you.

Sure this is the definition

name: CI

on: [push]

jobs:  
build:

runs-on: ubuntu-latest

steps:

- name: Login  
uses: actions-hub/docker/login@master  
env:  
DOCKER\_USERNAME: ${{ secrets.DOCKER\_USERNAME }}  
DOCKER\_PASSWORD: ${{ secrets.DOCKER\_PASSWORD }}
- name: Build  
uses: okteto/actions/build@v3.1  
with:  
token: ${{ secrets.OKTETO\_TOKEN }}  
tag: ${{ secrets.DOCKER\_USERNAME }}/curto:${{ github.sha }}
- name: Get Kubeconfig  
uses: okteto/actions/namespace@v3.1  
id: url-shortner-mfvitale  
with:  
token: ${{ secrets.OKTETO\_TOKEN }}  
namespace: url-shortner-mfvitale
- name: Deploy and Wait  
uses: okteto/actions/deploy@v3.1  
env:  
KUBECONFIG: ${{ steps.namespace.outputs.kubeconfig }}  
with:  
namespace: url-shortner-mfvitale  
manifest: deploy/k8s.yml  
tag: ${{ secrets.DOCKER\_USERNAME }}/curto:${{ github.sha }}  
waitOn: deployment/curto
- name: Verify  
uses: srt32/uptime@master  
with:  
url-to-hit: “[https://curto-mfvitale.cloud.okteto.net](https://curto-mfvitale.cloud.okteto.net)”  
expected-statuses: “200”

---

<div class="post-metadata">

**Author:** ![ramiro](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/ramiro/32/6_2.png) [@ramiro](https://community.okteto.com/u/ramiro)\
**Post date:** [October 22, 2022, 6:24pm UTC](https://community.okteto.com/t/okteto-github-action/301/4 "2022-10-22T18:24:48Z")

</div>

Ah, your action is missing the checkout command to get your source code. Try adding the following as the first step:

```auto
- name: checkout
   uses: actions/checkout@master

```

---

<div class="post-metadata">

**Author:** ![ramiro](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/ramiro/32/6_2.png) [@ramiro](https://community.okteto.com/u/ramiro)\
**Post date:** [October 22, 2022, 6:26pm UTC](https://community.okteto.com/t/okteto-github-action/301/5 "2022-10-22T18:26:35Z")

</div>

BTW, if your repository has a okteto.yml file, or a docker-compose.yaml, you check out the [deploy pipeline](https://github.com/marketplace/actions/okteto-pipeline) action, it’ll automatically do most of the steps that you have in your file.

[This doc](https://www.okteto.com/docs/cloud/preview-environments/preview-environments-github/) has an end to end example, in case it helps.

---

<div class="post-metadata">

**Author:** ![mfvitale](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/mfvitale/32/192_2.png) [@mfvitale](https://community.okteto.com/u/mfvitale)\
**Post date:** [October 23, 2022, 9:36am UTC](https://community.okteto.com/t/okteto-github-action/301/6 "2022-10-23T09:36:29Z")

</div>

Worked! Thank you so much.

---

<div class="post-metadata">

**Author:** ![mfvitale](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/mfvitale/32/192_2.png) [@mfvitale](https://community.okteto.com/u/mfvitale)\
**Post date:** [October 29, 2022, 10:08pm UTC](https://community.okteto.com/t/okteto-github-action/301/7 "2022-10-29T22:08:00Z")

</div>

@ramiro Is there a way to use secrets (with kustomize) and the deploy action I used?

Which is the best way?

Thanks,  
Mario

---

<div class="post-metadata">

**Author:** ![ramiro](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/ramiro/32/6_2.png) [@ramiro](https://community.okteto.com/u/ramiro)\
**Post date:** [October 30, 2022, 8:50pm UTC](https://community.okteto.com/t/okteto-github-action/301/8 "2022-10-30T20:50:19Z")

</div>

Would you mind posting a separate question for that topic?
