This repo serves as a base to build docker images with Forgejo Actions and is based of toras9000/test-forgejo-workflow repo excluding certs, DNS and C# files.
To use Forgejo Actions, you will need to set up Forgejo runners to perform the actions. The runners can be in the same machine as Forgejo instance or in a seperate machine (Forgejo recommends to use a different machine).
Follow the setup in docker-runner-setup folder to create the Forgejo runner via docker compose.
For building images for docker (other than your project files),
.
├── .forgejo/
│ └── workflows/
│ └── docker.yml
├── Dockerfile
└── docker-bake.hcl
You can edit the platforms the images should be available to in the docker-bake.hcl.
Note that, building successfully does not mean working successfully.
Most of the time, it should work fine but there may edge cases especially with linux/arm/v7 images.
on:
push:
branches:
# - 'main'
# - 'v*.*.*' # For ex, "v1.0.0" ("va.2.c" also works)
- "dev/v[0-9]+.[0-9]+.[0-9]+" # For ex, "dev/v1.0.0"
tags:
- 'v*'
workflow_dispatch:
You can specify the branch name in branches when there is a git push.
If you need to run the action on any push on main branch. Then you will use below config.
on:
push:
branches:
- 'main'
You can use regex pattern to have the action run on multiple branches.
For example, dev/v[0-9]+.[0-9]+.[0-9]+ if you create branch names like dev/v0.0.1 etc.
You can enable the action only when you create tags. It is naming pattern is similar to branches.
If you want to run the action on any branch or tag, use *. Not recommended but possible.
on:
push:
tags:
- '*'
workflow_dispatch is used when you want to manually trigger the workflow.
You can choose the name of branch/tag you want to run the action with (and that will be one of the tags other than the latest).
on:
workflow_dispatch:
Well as far as I know this repo works for me. But if there any info which are unclear feel free to raise an issue or suggest any modifications to make it better.
Possible todo, to add some more Dockerfile examples.
This repo is licensed under MIT.