Publish multi-platform Docker images to Gitea registry
Publish Docker Image / Build and publish amd64 and arm64 (push) Failing after 1m5s
Publish Docker Image / Build and publish amd64 and arm64 (push) Failing after 1m5s
This commit is contained in:
1 parent
453d9cfe74
commit
c69b5fcee8
5 files changed
+120
-2
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
db/
|
||||||
|
build/
|
||||||
|
*.test
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
name: Publish Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: gitea.bytevibe.dev
|
||||||
|
IMAGE: gitea.bytevibe.dev/gary/metatube-server
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build and publish amd64 and arm64
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out code and version tags
|
||||||
|
uses: https://github.com/actions/checkout@v7
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Check registry credentials
|
||||||
|
env:
|
||||||
|
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$REGISTRY_TOKEN" ]; then
|
||||||
|
echo "Add the REGISTRY_TOKEN repository secret with package read/write permission."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: https://github.com/docker/setup-qemu-action@v4
|
||||||
|
with:
|
||||||
|
platforms: amd64,arm64
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: https://github.com/docker/setup-buildx-action@v4
|
||||||
|
|
||||||
|
- name: Log in to Gitea Container Registry
|
||||||
|
uses: https://github.com/docker/login-action@v4
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: gary
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Generate image tags and labels
|
||||||
|
id: meta
|
||||||
|
uses: https://github.com/docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ${{ env.IMAGE }}
|
||||||
|
flavor: |
|
||||||
|
latest=false
|
||||||
|
tags: |
|
||||||
|
type=raw,value=latest,enable=${{ gitea.ref == 'refs/heads/main' }}
|
||||||
|
type=sha,format=long
|
||||||
|
type=ref,event=tag
|
||||||
|
labels: |
|
||||||
|
org.opencontainers.image.source=https://gitea.bytevibe.dev/gary/metatube-server
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: https://github.com/docker/build-push-action@v7
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile
|
||||||
|
push: true
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
+1
-1
@@ -8,7 +8,7 @@ RUN apk add --update --no-cache --no-progress make git \
|
|||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
LABEL org.opencontainers.image.licenses=Apache-2.0
|
LABEL org.opencontainers.image.licenses=Apache-2.0
|
||||||
LABEL org.opencontainers.image.source="https://github.com/metatube-community/metatube-sdk-go"
|
LABEL org.opencontainers.image.source="https://gitea.bytevibe.dev/gary/metatube-server"
|
||||||
|
|
||||||
COPY --from=builder /src/build/metatube-server .
|
COPY --from=builder /src/build/metatube-server .
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ Metadata Tube SDK in Golang.
|
|||||||
- [Contents](#contents)
|
- [Contents](#contents)
|
||||||
- [Features](#features)
|
- [Features](#features)
|
||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
|
- [Gitea Docker Deployment](#gitea-docker-deployment)
|
||||||
- [Credits](#credits)
|
- [Credits](#credits)
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
|
|
||||||
@@ -45,6 +46,47 @@ the below Go command to install SDK.
|
|||||||
go get -u github.com/metatube-community/metatube-sdk-go
|
go get -u github.com/metatube-community/metatube-sdk-go
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Gitea Docker Deployment
|
||||||
|
|
||||||
|
This fork publishes container images to
|
||||||
|
`gitea.bytevibe.dev/gary/metatube-server` using
|
||||||
|
`.gitea/workflows/docker.yml`. Images support both `linux/amd64` and
|
||||||
|
`linux/arm64`; Docker selects the matching architecture when pulling.
|
||||||
|
|
||||||
|
### Actions Setup
|
||||||
|
|
||||||
|
1. Enable Actions and Packages for the Gitea repository.
|
||||||
|
2. Register a Linux runner with the `ubuntu-latest` label. Its job environment
|
||||||
|
must have access to a Docker daemon, and permit QEMU/binfmt registration for
|
||||||
|
building the other architecture. The runner must also be able to download
|
||||||
|
the actions from GitHub and base images and Go dependencies from their registries.
|
||||||
|
3. Create a personal access token for `gary` with package read/write permission.
|
||||||
|
Add it under repository **Settings > Actions > Secrets** with the name
|
||||||
|
`REGISTRY_TOKEN`. Do not commit the token to the repository.
|
||||||
|
|
||||||
|
Pushes to `main` publish `latest` and `sha-<full commit hash>`. Pushes of tags
|
||||||
|
starting with `v` publish that tag and the commit tag without changing `latest`.
|
||||||
|
The commit tag can be used to deploy or roll back to a specific build. The
|
||||||
|
original `.github/workflows/` files are upstream GitHub workflows; this fork's
|
||||||
|
Gitea publishing workflow uses the Gitea registry.
|
||||||
|
|
||||||
|
### Deploy or Update
|
||||||
|
|
||||||
|
The included `docker-compose.yaml` uses the Gitea image. If authentication is
|
||||||
|
required, log in with your Gitea username and a token with package read permission:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker login gitea.bytevibe.dev -u gary
|
||||||
|
docker pull gitea.bytevibe.dev/gary/metatube-server:latest
|
||||||
|
docker compose pull metatube
|
||||||
|
docker compose up -d metatube
|
||||||
|
```
|
||||||
|
|
||||||
|
Run these commands on the deployment server in the directory containing your
|
||||||
|
Compose file. Keep its existing database, volumes, token, and other settings
|
||||||
|
when changing the image of an existing deployment. Publishing a new image
|
||||||
|
does not update running containers automatically.
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
| Library | Description |
|
| Library | Description |
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
metatube:
|
metatube:
|
||||||
image: ghcr.io/metatube-community/metatube-server:latest
|
image: gitea.bytevibe.dev/gary/metatube-server:latest
|
||||||
container_name: metatube
|
container_name: metatube
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
|
|||||||
Reference in new issue
Block a user