Skip to content

BaccanoMob/forgejo-actions-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

forgejo-actions-docker

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.

Forgejo Actions

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.

Docker building prerequisites

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 action

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:

Issues

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.

License

This repo is licensed under MIT.

About

Basic setup for forgejo actions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published