Skip to content

Add workflow to build SimpleX Server Container images #1

Add workflow to build SimpleX Server Container images

Add workflow to build SimpleX Server Container images #1

name: Build and Publish SimpleX Docker Image
on:
workflow_dispatch:
inputs:
simplex_version:
description: 'SimpleX Server version to build (e.g. v6.0.4 or v6.1.0-beta.1). Use "latest" to build the most recent version'
required: true
default: 'latest'
jobs:
build:

Check failure on line 12 in .github/workflows/build-simplex-server.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-simplex-server.yml

Invalid workflow file

You have an error in your yaml syntax on line 12
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
env:
REPO_URL: https://github.com/simplex-chat/simplex-chat.git
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch latest tags from SimpleX repository
run: |
git clone --depth=1 --tags $REPO_URL
cd simplex-chat
# Find the latest tag, filtering out any non-version tags like 'v*'
LATEST_TAG=$(git tag -l --sort=-v:refname 'v*' | head -n 1)
echo "Latest tag found: $LATEST_TAG"
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
- name: Determine version to build
run: |
if [ "${{ github.event.inputs.simplex_version }}" == "latest" ]; then
echo "Using latest tag: $LATEST_TAG"
echo "SIMPLEX_VERSION=$LATEST_TAG" >> $GITHUB_ENV
else
echo "Using specified version: ${{ github.event.inputs.simplex_version }}"
echo "SIMPLEX_VERSION=${{ github.event.inputs.simplex_version }}" >> $GITHUB_ENV
- name: Build and push Docker image for x86 and arm
run: |
echo "Building SimpleX version: $SIMPLEX_VERSION"
docker buildx build \
--platform linux/amd64,linux/arm64 \
--file .github/Dockerfile.simplex \
--tag ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:$SIMPLEX_VERSION \
--build-arg SIMPLEX_VERSION=$SIMPLEX_VERSION \
--push \
.
- name: Image build complete
run: echo "Docker image has been built and published."