Skip to content

Merge pull request #543 from gitroomhq/feat/short-linking #77

Merge pull request #543 from gitroomhq/feat/short-linking

Merge pull request #543 from gitroomhq/feat/short-linking #77

---
name: "Build Containers"
on:
workflow_dispatch:
push:
tags:
- '*'
jobs:
build-containers-common:
runs-on: ubuntu-latest
outputs:
containerver: ${{ steps.getcontainerver.outputs.containerver }}
steps:
- name: Get Container Version
id: getcontainerver
run: |
echo "containerver=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
build-containers:
needs: build-containers-common
strategy:
matrix:
include:
- runnertags: ubuntu-latest
arch: amd64
- runnertags: [self-hosted, ARM64]
arch: arm64
runs-on: ${{ matrix.runnertags }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: docker build
run: ./var/docker/docker-build.sh
- name: Print post-build debug info
run: |
docker images
- name: docker tag
env:
CONTAINERVER: ${{ needs.build-containers-common.outputs.containerver }}
run: |
docker tag localhost/postiz ghcr.io/gitroomhq/postiz-app:${{ env.CONTAINERVER }}-${{ matrix.arch }}
docker push ghcr.io/gitroomhq/postiz-app:${{ env.CONTAINERVER }}-${{ matrix.arch }}
docker tag localhost/postiz-devcontainer ghcr.io/gitroomhq/postiz-devcontainer:${{ env.CONTAINERVER }}-${{ matrix.arch }}
docker push ghcr.io/gitroomhq/postiz-devcontainer:${{ env.CONTAINERVER }}-${{ matrix.arch }}
build-container-manifest:
needs: [build-containers, build-containers-common]
runs-on: ubuntu-latest
steps:
- name: Login to ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Create Docker Manifest
env:
CONTAINERVER: ${{ needs.build-containers-common.outputs.containerver }}
run: |
docker manifest create \
ghcr.io/gitroomhq/postiz-app:latest \
ghcr.io/gitroomhq/postiz-app:${{ env.CONTAINERVER }}-arm64 \
ghcr.io/gitroomhq/postiz-app:${{ env.CONTAINERVER }}-amd64
docker manifest push ghcr.io/gitroomhq/postiz-app:latest
docker manifest create \
ghcr.io/gitroomhq/postiz-devcontainer:latest \
ghcr.io/gitroomhq/postiz-devcontainer:${{ env.CONTAINERVER }}-arm64 \
ghcr.io/gitroomhq/postiz-devcontainer:${{ env.CONTAINERVER }}-amd64
docker manifest push ghcr.io/gitroomhq/postiz-devcontainer:latest