Some checks failed
Build ARM64 Linux / build-arm64 (push) Has been cancelled
Build Docker Linux ARM64 / build-docker-linux-arm64 (push) Has been cancelled
Build Linux x64 / build-linux-x64 (push) Has been cancelled
Build Windows x64 / build-windows-x64 (push) Has been cancelled
Build Docker Linux ARM64 Release / build-docker-linux-arm64-release (push) Failing after 46s
104 lines
3.0 KiB
YAML
104 lines
3.0 KiB
YAML
name: Build Docker Linux ARM64 Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build-docker-linux-arm64-release:
|
|
runs-on: [self-hosted, linux, arm64, docker]
|
|
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Install required packages
|
|
shell: bash
|
|
run: |
|
|
set -e
|
|
if command -v apk >/dev/null 2>&1; then
|
|
echo "Using apk (Alpine)"
|
|
apk add --no-cache \
|
|
git curl wget unzip bash nodejs npm docker
|
|
elif command -v apt-get >/dev/null 2>&1; then
|
|
echo "Using apt (Debian/Ubuntu)"
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
git curl wget unzip bash nodejs npm docker.io
|
|
else
|
|
echo "Unsupported OS package manager"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
# Login to Gitea Container Registry
|
|
- name: Login to Gitea Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: http://172.19.0.2:3000
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# Docker metadata
|
|
- name: Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ github.server_url }}/${{ github.repository }}
|
|
tags: |
|
|
type=ref,event=tag
|
|
type=raw,value=latest
|
|
|
|
# Buildx
|
|
- name: Setup Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
# Build & Push
|
|
- name: Build and Push Docker Image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
platforms: linux/arm64
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
# Build local image for tarball
|
|
- name: Build local Docker image
|
|
run: docker build -t couchlog-linux-arm64 .
|
|
|
|
- name: Save Docker image as tar
|
|
run: docker save couchlog-linux-arm64 -o CouchLog-Linux-ARM64-Docker-Image.tar
|
|
|
|
# Create Release (Gitea compatible)
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref_name }}
|
|
release_name: ${{ github.ref_name }}
|
|
draft: false
|
|
prerelease: false
|
|
body: |
|
|
## Docker Image (ARM64)
|
|
|
|
```bash
|
|
docker pull ${{ github.server_url }}/${{ github.repository }}:${{ github.ref_name }}
|
|
```
|
|
|
|
- name: Upload Docker Image Tarball
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: CouchLog-Linux-ARM64-Docker-Image.tar
|
|
asset_name: CouchLog-Linux-ARM64-Docker-Image.tar
|
|
asset_content_type: application/x-tar
|