runner/.forgejo/workflows/docker-build-push-action-in-lxc.yml
Renovate Bot 10a9ab9001
Some checks are pending
Build release / release (push) Waiting to run
publish / publish (push) Waiting to run
Update code.forgejo.org/forgejo/forgejo Docker tag to v11.0.7 (#1113)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [code.forgejo.org/forgejo/forgejo](https://forgejo.org) ([source](https://codeberg.org/forgejo/forgejo)) | patch | `11.0.6` -> `11.0.7` |

---

### Release Notes

<details>
<summary>forgejo/forgejo (code.forgejo.org/forgejo/forgejo)</summary>

### [`v11.0.7`](https://codeberg.org/forgejo/forgejo/releases/tag/v11.0.7)

[Compare Source](https://codeberg.org/forgejo/forgejo/compare/v11.0.6...v11.0.7)

See <https://codeberg.org/forgejo/forgejo/src/branch/forgejo/release-notes-published/11.0.7.md>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTIuOSIsInVwZGF0ZWRJblZlciI6IjQxLjE1Mi45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJLaW5kL0RlcGVuZGVuY3lVcGRhdGUiLCJydW4tZW5kLXRvLWVuZC10ZXN0cyJdfQ==-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1113
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2025-10-27 07:33:24 +00:00

85 lines
3.2 KiB
YAML

#
# Example that requires a Forgejo runner with an [LXC backend](https://forgejo.org/docs/latest/admin/actions/runner-installation/#setting-up-the-container-environment).
#
# - Start a Forgejo instance to be used as a container registry
# - Build a container image using the [docker/build-push-action](https://code.forgejo.org/docker/build-push-action) action
# - Push the image to the Forgejo instance
# - Retrieve the image
#
# Runs of this workflow can be seen in [the Forgejo runner](https://code.forgejo.org/forgejo/runner/actions?workflow=docker-build-push-action-in-lxc.yml) logs.
#
name: example
on:
push:
branches:
- 'main'
pull_request:
paths:
- examples/docker-build-push-action/**
- .forgejo/workflows/docker-build-push-action-in-lxc.yml
enable-email-notifications: true
env:
FORGEJO_VERSION: 11.0.7 # renovate: datasource=docker depName=code.forgejo.org/forgejo/forgejo
FORGEJO_USER: root
FORGEJO_PASSWORD: admin1234
jobs:
docker-build-push-action-in-lxc:
if: vars.ROLE == 'forgejo-coding'
runs-on: lxc-bookworm
steps:
- name: install Forgejo so it can be used as a container registry
id: registry
uses: https://data.forgejo.org/actions/setup-forgejo@v3.0.4
with:
user: ${{ env.FORGEJO_USER }}
password: ${{ env.FORGEJO_PASSWORD }}
binary: https://code.forgejo.org/forgejo/forgejo/releases/download/v${{ env.FORGEJO_VERSION }}/forgejo-${{ env.FORGEJO_VERSION }}-linux-amd64
lxc-ip-prefix: 10.0.9
- name: enable insecure / http uploads to the Forgejo registry
run: |-
set -x
# the docker daemon was implicitly installed when Forgejo was
# installed in the previous step. But it will refuse to connect
# to an insecure / http registry by default and must be told
# otherwise
cat > /etc/docker/daemon.json <<EOF
{
"insecure-registries" : ["${{ steps.registry.outputs.host-port }}"]
}
EOF
systemctl restart docker
- uses: https://data.forgejo.org/docker/setup-qemu-action@v3
- uses: https://data.forgejo.org/docker/setup-buildx-action@v2
with:
# insecure / http connections to the registry are allowed
config-inline: |
[registry."${{ steps.registry.outputs.host-port }}"]
http = true
- name: login to the Forgejo registry
uses: https://data.forgejo.org/docker/login-action@v3
with:
registry: ${{ steps.registry.outputs.host-port }}
username: ${{ env.FORGEJO_USER }}
password: ${{ env.FORGEJO_PASSWORD }}
- name: build and push to the Forgejo registry
uses: https://data.forgejo.org/docker/build-push-action@v5
with:
context: examples/docker-build-push-action
push: true
tags: ${{ steps.registry.outputs.host-port }}/root/testimage:latest
cache-from: type=gha,scope=docker-build-push-action-in-lxc
cache-to: type=gha,scope=docker-build-push-action-in-lxc
- name: verify the image can be read from the Forgejo registry
run: |
set -x
docker pull ${{ steps.registry.outputs.host-port }}/root/testimage:latest