# Deploy code from Gitea repo to Live wwwroot folder

**URL:** <https://forum.gitea.com/t/deploy-code-from-gitea-repo-to-live-wwwroot-folder/7991>\
**Category:** Install/Maintain/Configure\
**Created:** [October 21, 2023, 3:49am UTC](https://forum.gitea.com/t/deploy-code-from-gitea-repo-to-live-wwwroot-folder/7991 "2023-10-21T03:49:38Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![hardikvagadiya.ows](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/hardikvagadiya.ows/32/4108_2.png) [@hardikvagadiya.ows](https://forum.gitea.com/u/hardikvagadiya.ows)\
**Post date:** [October 21, 2023, 3:49am UTC](https://forum.gitea.com/t/deploy-code-from-gitea-repo-to-live-wwwroot-folder/7991/1 "2023-10-21T03:49:38Z")

</div>

Hi,

I have following server configuration:

Development Machine  
Ubuntu 22  
Apache with mySQL

I have created a website on the machine. I have installed Gitea on the same server (Self-Hosted Installation).

I created a local repository and the flow is working perfect.

Now, when my developer pushes the files in gitea repository, I want to copy that file to live website path i.e., /var/www/html/website.com

Can someone please advise on how can I do this?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![linkp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/linkp/32/4833_2.png) [@linkp](https://forum.gitea.com/u/linkp)\
**Post date:** [October 21, 2023, 4:20am UTC](https://forum.gitea.com/t/deploy-code-from-gitea-repo-to-live-wwwroot-folder/7991/2 "2023-10-21T04:20:45Z")

</div>

Have you looked into

> **[Gitea Actions | Gitea Documentation](https://docs.gitea.com/usage/actions/overview)**
>
> Starting with Gitea 1.19, Gitea Actions are available as a built-in CI/CD solution.

---

<div class="post-metadata">

**Author:** ![hardikvagadiya.ows](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/hardikvagadiya.ows/32/4108_2.png) [@hardikvagadiya.ows](https://forum.gitea.com/u/hardikvagadiya.ows)\
**Post date:** [October 21, 2023, 5:43am UTC](https://forum.gitea.com/t/deploy-code-from-gitea-repo-to-live-wwwroot-folder/7991/3 "2023-10-21T05:43:18Z")

</div>

Yup, I checked it already.

But, I do not understand how can I install act\_installer in ubuntu and implement it. I coundn’t find the document for installation…

---

<div class="post-metadata">

**Author:** ![hardikvagadiya.ows](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/hardikvagadiya.ows/32/4108_2.png) [@hardikvagadiya.ows](https://forum.gitea.com/u/hardikvagadiya.ows)\
**Post date:** [October 21, 2023, 5:45am UTC](https://forum.gitea.com/t/deploy-code-from-gitea-repo-to-live-wwwroot-folder/7991/4 "2023-10-21T05:45:25Z")

</div>

Ahh, I found the docs. Let me try it. Thanks for your help.

---

<div class="post-metadata">

**Author:** ![hardikvagadiya.ows](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/hardikvagadiya.ows/32/4108_2.png) [@hardikvagadiya.ows](https://forum.gitea.com/u/hardikvagadiya.ows)\
**Post date:** [October 23, 2023, 6:30am UTC](https://forum.gitea.com/t/deploy-code-from-gitea-repo-to-live-wwwroot-folder/7991/5 "2023-10-23T06:30:18Z")

</div>

Hi,

The actions work fine with my repository. I tested it by referring to [Quick Start | Gitea Documentation](https://docs.gitea.com/usage/actions/quickstart)

Now, I want to copy the files from repository to live site path.

But, I couldn’t find the source path of the content uploaded in repository. Where do my files reside when I push them?

Or I do need to pull content from git url i.e.

[http://192.168.0.111:3000/git-admin/Test.git](http://192.168.0.111:3000/git-admin/Test.git)

---

<div class="post-metadata">

**Author:** ![hardikvagadiya.ows](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/hardikvagadiya.ows/32/4108_2.png) [@hardikvagadiya.ows](https://forum.gitea.com/u/hardikvagadiya.ows)\
**Post date:** [October 23, 2023, 7:13am UTC](https://forum.gitea.com/t/deploy-code-from-gitea-repo-to-live-wwwroot-folder/7991/6 "2023-10-23T07:13:44Z")

</div>

I created a shell script to copy content from gitea repository to /var/www/html/website.com path.

When I check the action tab, it is showing failure…

```auto
sh /home/harry/code-deploy.sh
sh: 0: cannot open /home/harry/code-deploy.sh: No such file

```

The script has the code to pull content from my gitea repository to live site path. If I run that script manually it runs fine without any issue.

When I added that script in gitea yaml file, the action is failing.

The code is like this:

```auto
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions
on: [push]

jobs:
  Explore-Gitea-Actions:
    runs-on: ubuntu-latest
    steps:
      - run: sh /home/harry/code-deploy.sh

```

Can someone please advice what I am doing wrong?

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [October 23, 2023, 9:33am UTC](https://forum.gitea.com/t/deploy-code-from-gitea-repo-to-live-wwwroot-folder/7991/7 "2023-10-23T09:33:41Z")

</div>

> [@hardikvagadiya.ows](#):
>
> `code-deploy.sh`

Where is the file stored?

---

<div class="post-metadata">

**Author:** ![hardikvagadiya.ows](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/hardikvagadiya.ows/32/4108_2.png) [@hardikvagadiya.ows](https://forum.gitea.com/u/hardikvagadiya.ows)\
**Post date:** [October 24, 2023, 4:15am UTC](https://forum.gitea.com/t/deploy-code-from-gitea-repo-to-live-wwwroot-folder/7991/8 "2023-10-24T04:15:58Z")

</div>

code-deploy.sh ==\> On the same server where my website and gitea as well as runner are installed… Path: /home/harry/code-deploy.sh

Source code ==\> /home/abc2/harry-test

To be uploaded path ==\> /var/www/html/website.com

---

<div class="post-metadata">

**Author:** ![hardikvagadiya.ows](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/hardikvagadiya.ows/32/4108_2.png) [@hardikvagadiya.ows](https://forum.gitea.com/u/hardikvagadiya.ows)\
**Post date:** [October 24, 2023, 4:56am UTC](https://forum.gitea.com/t/deploy-code-from-gitea-repo-to-live-wwwroot-folder/7991/9 "2023-10-24T04:56:28Z")

</div>

Okay, it looks like when I push changes to repository, it’s present working directory is /workspace/git-admin/Harry-Test

I temporarily disabled the shell script.

And even if I try to just sudo su, it can’t perform the action. So, I believe it creates a temporary path to perform actions. That path is not even present on the server physically.

Not sure how to execute my shell script using this Gitea actions.

If anyone has any idea, please share.

Thanks,

See the attached output screen capture

 ![Screenshot from 2023-10-24 10-22-16](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/3/3439c62140afe0fecb9e962b73de951fe05ddd88.png)

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [October 24, 2023, 1:38pm UTC](https://forum.gitea.com/t/deploy-code-from-gitea-repo-to-live-wwwroot-folder/7991/10 "2023-10-24T13:38:49Z")

</div>

There is no `sudo` command installed on the default container. You can install `sudo` with `apt-get install -y sudo` before use the command.

---

<div class="post-metadata">

**Author:** ![hardikvagadiya.ows](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/hardikvagadiya.ows/32/4108_2.png) [@hardikvagadiya.ows](https://forum.gitea.com/u/hardikvagadiya.ows)\
**Post date:** [October 25, 2023, 4:29am UTC](https://forum.gitea.com/t/deploy-code-from-gitea-repo-to-live-wwwroot-folder/7991/11 "2023-10-25T04:29:42Z")

</div>

Thanks, lunny.

But, my script is at outside of docker container.

Shell script path: /home/ows4/code-deploy.sh

If I execute the script command line, it works fine.

But, when I add it in YAML file - GITEA action, it says no such file here. See the attached.

I believe, it is trying to find the shell script path within the docker container. How can I tell that action to find and execute that script outside of the docker. (P.S. I am new to docker. I do not have much knowledge in docker yet…)

Thanks in advance.

 ![Screenshot-1](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/0/036baa72a02eebc5450d2a03debd79cd5fceb3eb.png)

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [October 25, 2023, 5:53am UTC](https://forum.gitea.com/t/deploy-code-from-gitea-repo-to-live-wwwroot-folder/7991/12 "2023-10-25T05:53:14Z")

</div>

How about putting the file into your repository?

---

<div class="post-metadata">

**Author:** ![hardikvagadiya.ows](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/hardikvagadiya.ows/32/4108_2.png) [@hardikvagadiya.ows](https://forum.gitea.com/u/hardikvagadiya.ows)\
**Post date:** [October 25, 2023, 6:46am UTC](https://forum.gitea.com/t/deploy-code-from-gitea-repo-to-live-wwwroot-folder/7991/13 "2023-10-25T06:46:41Z")

</div>

Same error.

when I did PWD on the action, it shows path: /workspace/git-admin/harry-test

I believe, the action is trying to find deploy.sh script in above path. Not sure how come the present working directory is set to that path…

 ![Screenshot-1](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/5/5576c84465044a46044496c991d1e0e1b1f86d0f.png)

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [October 25, 2023, 7:50am UTC](https://forum.gitea.com/t/deploy-code-from-gitea-repo-to-live-wwwroot-folder/7991/14 "2023-10-25T07:50:55Z")

</div>

If you can confirm the file is there, that means it needs executable permission. You can `chmod +x <file_name>` before you push it to repository.
