This repository has been archived on 2023-02-13. You can view files and clone it, but cannot push or open issues or pull requests.
Jason Song 867fd7adde Implement actions (#21937)
Close #13539.

Co-authored by: @lunny @appleboy @fuxiaohei and others.

Related projects:

### Summary

The target of this PR is to bring a basic implementation of "Actions",
an internal CI/CD system of Gitea. That means even though it has been
merged, the state of the feature is **EXPERIMENTAL**, and please note

- It is disabled by default;
- It shouldn't be used in a production environment currently;
- It shouldn't be used in a public Gitea instance currently;
- Breaking changes may be made before it's stable.

**Please comment on #13539 if you have any different product design
ideas**, all decisions reached there will be adopted here. But in this
PR, we don't talk about **naming, feature-creep or alternatives**.

### ⚠️ Breaking

`gitea-actions` will become a reserved user name. If a user with the
name already exists in the database, it is recommended to rename it.

### Some important reviews

- What is `DEFAULT_ACTIONS_URL` in `app.ini` for?
- Why the api for runners is not under the normal `/api/v1` prefix?
- Why DBFS?
- Why ignore events triggered by `gitea-actions` bot?
- Why there's no permission control for actions?

### What it looks like


#### Manage runners

<img width="1792" alt="image"

#### List runs

<img width="1792" alt="image"

#### View logs

<img width="1792" alt="image"


### How to try it


#### 1. Start Gitea

Clone this branch and [install from

Add additional configurations in `app.ini` to enable Actions:

ENABLED = true

Start it.

If all is well, you'll see the management page of runners:

<img width="1792" alt="image"

#### 2. Start runner

Clone the [act_runner](, and follow
to start it.

If all is well, you'll see a new runner has been added:

<img width="1792" alt="image"

#### 3. Enable actions for a repo

Create a new repo or open an existing one, check the `Actions` checkbox
in settings and submit.

<img width="1792" alt="image"
<img width="1792" alt="image"

If all is well, you'll see a new tab "Actions":

<img width="1792" alt="image"

#### 4. Upload workflow files

Upload some workflow files to `.gitea/workflows/xxx.yaml`, you can
follow the [quickstart](
of GitHub Actions. Yes, Gitea Actions is compatible with GitHub Actions
in most cases, you can use the same demo:

name: GitHub Actions Demo
run-name: ${{ }} is testing out GitHub Actions 🚀
on: [push]
    runs-on: ubuntu-latest
      - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
      - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
      - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
      - name: Check out repository code
        uses: actions/checkout@v3
      - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
      - run: echo "🖥️ The workflow is now ready to test your code on the runner."
      - name: List files in the repository
        run: |
          ls ${{ github.workspace }}
      - run: echo "🍏 This job's status is ${{ job.status }}."

If all is well, you'll see a new run in `Actions` tab:

<img width="1792" alt="image"

#### 5. Check the logs of jobs

Click a run and you'll see the logs:

<img width="1792" alt="image"

#### 6. Go on

You can try more examples in [the
of GitHub Actions, then you might find a lot of bugs.

Come on, PRs are welcome.


See also: [Feature Preview: Gitea


Co-authored-by: a1012112796 <>
Co-authored-by: Lunny Xiao <>
Co-authored-by: delvh <>
Co-authored-by: ChristopherHX <>
Co-authored-by: John Olheiser <>
2023-01-31 09:45:19 +08:00
.. Fix various typos of software names (#18083) 2021-12-24 11:56:57 +08:00 Add markdownlint (#20512) 2022-07-28 09:22:47 +08:00 Fix various typos of software names (#18083) 2021-12-24 11:56:57 +08:00 Implement actions (#21937) 2023-01-31 09:45:19 +08:00 Add option to enable CAPTCHA validation for login (#21638) 2022-11-22 21:13:18 +00:00 Fix PlantUML example in document (#21142) 2022-09-11 22:14:46 +08:00 Update documentation to reflect #15219 (#16442) 2021-07-15 20:49:12 +01:00 Update docs and comments to remove macaron (#14491) 2021-01-29 16:35:30 +01:00 Add markdownlint (#20512) 2022-07-28 09:22:47 +08:00 Fix stylesheet HTML snippet for external renderers documentation (#22435) 2023-01-13 23:25:15 +00:00 Clarify logging documentation (#21665) 2022-11-22 09:04:29 +08:00 Refactor docs (#21627) 2022-10-31 23:16:19 +00:00 Add markdownlint (#20512) 2022-07-28 09:22:47 +08:00 Reformat docs (#13897) 2020-12-09 07:47:06 +01:00 Improve pull/ push mirror documentation (especially for GitHub) (#21801) 2022-11-14 21:17:39 +00:00 Add markdownlint (#20512) 2022-07-28 09:22:47 +08:00 Add hint to GNUPGHOME environment variable (#20134) 2022-07-10 17:04:46 +08:00