Compare commits
2
Commits
a2d899be6f
...
89194dd94a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89194dd94a | ||
|
|
97168ea0e5 |
@@ -10,7 +10,6 @@ name: Images
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
tags: ['v*.*.*']
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
# Jobs that run docker builds use dejima-privileged; anything else should use
|
# Jobs that run docker builds use dejima-privileged; anything else should use
|
||||||
@@ -59,6 +58,12 @@ jobs:
|
|||||||
echo "host=$host" >> "$GITHUB_OUTPUT"
|
echo "host=$host" >> "$GITHUB_OUTPUT"
|
||||||
echo "owner=${GITHUB_REPOSITORY_OWNER,,}" >> "$GITHUB_OUTPUT"
|
echo "owner=${GITHUB_REPOSITORY_OWNER,,}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
# Shown in Settings, since images carry no version number
|
||||||
|
- name: Name the version
|
||||||
|
id: version
|
||||||
|
shell: bash
|
||||||
|
run: echo "sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- uses: docker/setup-buildx-action@v3
|
- uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- uses: docker/login-action@v3
|
- uses: docker/login-action@v3
|
||||||
@@ -71,11 +76,7 @@ jobs:
|
|||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ steps.registry.outputs.host }}/${{ steps.registry.outputs.owner }}/${{ matrix.image }}
|
images: ${{ steps.registry.outputs.host }}/${{ steps.registry.outputs.owner }}/${{ matrix.image }}
|
||||||
tags: |
|
tags: type=raw,value=latest
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
||||||
type=ref,event=branch
|
|
||||||
|
|
||||||
- uses: docker/build-push-action@v6
|
- uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
@@ -85,5 +86,5 @@ jobs:
|
|||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
build-args: |
|
build-args: |
|
||||||
VERSION=${{ steps.meta.outputs.version }}
|
VERSION=${{ steps.version.outputs.sha }}
|
||||||
provenance: false
|
provenance: false
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ name: Images
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
tags: ['v*.*.*']
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
@@ -39,6 +38,12 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: echo "name=${GITHUB_REPOSITORY_OWNER,,}" >> "$GITHUB_OUTPUT"
|
run: echo "name=${GITHUB_REPOSITORY_OWNER,,}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
# Shown in Settings, since images carry no version number
|
||||||
|
- name: Name the version
|
||||||
|
id: version
|
||||||
|
shell: bash
|
||||||
|
run: echo "sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- uses: docker/setup-buildx-action@v3
|
- uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- uses: docker/login-action@v3
|
- uses: docker/login-action@v3
|
||||||
@@ -51,11 +56,7 @@ jobs:
|
|||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ghcr.io/${{ steps.owner.outputs.name }}/${{ matrix.image }}
|
images: ghcr.io/${{ steps.owner.outputs.name }}/${{ matrix.image }}
|
||||||
tags: |
|
tags: type=raw,value=latest
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
||||||
type=ref,event=branch
|
|
||||||
|
|
||||||
- uses: docker/build-push-action@v6
|
- uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
@@ -65,5 +66,5 @@ jobs:
|
|||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
build-args: |
|
build-args: |
|
||||||
VERSION=${{ steps.meta.outputs.version }}
|
VERSION=${{ steps.version.outputs.sha }}
|
||||||
provenance: false
|
provenance: false
|
||||||
|
|||||||
@@ -29,13 +29,11 @@ All three are built from this repository by `docker compose up -d --build`.
|
|||||||
### Prebuilt images
|
### Prebuilt images
|
||||||
|
|
||||||
Images are published to GitHub's container registry. To pull them instead of
|
Images are published to GitHub's container registry. To pull them instead of
|
||||||
building, set `IMAGE_PREFIX` in `.env`, ending in `/`, and optionally
|
building, set `IMAGE_PREFIX` in `.env`, ending in `/`. There's one tag,
|
||||||
`IMAGE_TAG`. `latest` is the newest release, `1.2` the newest of a minor
|
`latest`, built from the tip of `main`.
|
||||||
version, and `main` follows the `main` branch.
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
IMAGE_PREFIX=ghcr.io/branderson/
|
IMAGE_PREFIX=ghcr.io/branderson/
|
||||||
IMAGE_TAG=latest
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Then run `docker compose pull && docker compose up -d`. Images from another
|
Then run `docker compose pull && docker compose up -d`. Images from another
|
||||||
@@ -53,8 +51,7 @@ Two workflows build the same images with the same tags:
|
|||||||
|
|
||||||
`.gitea/workflows/images.yml` builds all three images on Gitea Actions and
|
`.gitea/workflows/images.yml` builds all three images on Gitea Actions and
|
||||||
pushes them to the Gitea instance's container registry, under the repository's
|
pushes them to the Gitea instance's container registry, under the repository's
|
||||||
owner. Pushes to `main` publish a `main` tag; `v1.2.3` tags publish `1.2.3`,
|
owner. Each push to `main` publishes `latest`. Its jobs run docker builds, so they need a runner labelled
|
||||||
`1.2` and `latest`. Its jobs run docker builds, so they need a runner labelled
|
|
||||||
`dejima-privileged`; jobs that don't build images should use `dejima-confined`.
|
`dejima-privileged`; jobs that don't build images should use `dejima-confined`.
|
||||||
It also needs a repository secret, `REGISTRY_TOKEN`: an access token with
|
It also needs a repository secret, `REGISTRY_TOKEN`: an access token with
|
||||||
package write access, belonging to the repository's owner, whom the workflow
|
package write access, belonging to the repository's owner, whom the workflow
|
||||||
|
|||||||
Reference in New Issue
Block a user