Some checks failed
Docker Push / build-and-push-image (push) Failing after 26m11s
78 lines
2.6 KiB
YAML
78 lines
2.6 KiB
YAML
name: Docker Push
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
|
|
env:
|
|
REGISTRY: git.nickbland.dev
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
jobs:
|
|
build-and-push-image:
|
|
runs-on: ubuntu-latest
|
|
if: contains(github.event.head_commit.message, '[release]') || contains(github.event.head_commit.message, '[stage]')
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set variables
|
|
run: |
|
|
if echo "${{ github.event.head_commit.message }}" | grep -q '\[release\]'; then
|
|
XPIPE_VERSION=$(cat version-main)
|
|
XPIPE_REPOSITORY="xpipe-io/xpipe"
|
|
XPIPE_PACKAGE="xpipe"
|
|
XPIPE_TAG="main"
|
|
else
|
|
XPIPE_VERSION=$(cat version-ptb)
|
|
XPIPE_REPOSITORY="xpipe-io/xpipe-ptb"
|
|
XPIPE_PACKAGE="xpipe-ptb"
|
|
XPIPE_TAG="ptb"
|
|
fi
|
|
|
|
echo "XPIPE_VERSION=$XPIPE_VERSION" >> $GITHUB_ENV
|
|
echo "XPIPE_REPOSITORY=$XPIPE_REPOSITORY" >> $GITHUB_ENV
|
|
echo "XPIPE_PACKAGE=$XPIPE_PACKAGE" >> $GITHUB_ENV
|
|
echo "XPIPE_TAG=$XPIPE_TAG" >> $GITHUB_ENV
|
|
|
|
- name: Log in to Gitea Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.CONTAINER_TOKEN }}
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
flavor: |
|
|
latest=${{ contains(github.event.head_commit.message, '[release]') }}
|
|
tags: |
|
|
type=raw,value=${{ env.XPIPE_TAG }}
|
|
labels: |
|
|
org.opencontainers.image.vendor=xpipe.io
|
|
org.opencontainers.image.authors=xpipe.io
|
|
org.opencontainers.image.documentation=https://github.com/xpipe-io/xpipe-webtop
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
build-args: |
|
|
XPIPE_VERSION=${{ env.XPIPE_VERSION }}
|
|
XPIPE_REPOSITORY=${{ env.XPIPE_REPOSITORY }}
|
|
XPIPE_PACKAGE=${{ env.XPIPE_PACKAGE }}
|
|
platforms: ${{ contains(github.event.head_commit.message, '[release]') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
|