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
.. Improve documentation for PAM and static deployment (#21866) 2022-11-20 20:14:03 +00:00 Reformat docs (#13897) 2020-12-09 07:47:06 +01:00 Reformat docs (#13897) 2020-12-09 07:47:06 +01:00 Implement actions (#21937) 2023-01-31 09:45:19 +08:00 Implement actions (#21937) 2023-01-31 09:45:19 +08:00 Implement actions (#21937) 2023-01-31 09:45:19 +08:00 Add markdownlint (#20512) 2022-07-28 09:22:47 +08:00 Reformat docs (#13897) 2020-12-09 07:47:06 +01:00 Add markdownlint (#20512) 2022-07-28 09:22:47 +08:00 Add Webhook authorization header (#20926) 2022-11-03 20:23:20 +02:00 Add packagist webhook (#18224) 2022-01-23 21:46:30 +08:00 Add packagist webhook (#18224) 2022-01-23 21:46:30 +08:00