Skip to content

fix: Discord message chunking for long queue lists #299

fix: Discord message chunking for long queue lists

fix: Discord message chunking for long queue lists #299

Workflow file for this run

name: Build and Push Multi-Platform Docker Image
on:
# Build on releases (recommended for production)
release:
types: [published]
# Also allow develop branch for testing
push:
branches:
- develop # Dev builds → :develop
paths-ignore:
- 'CHANGELOG.md'
- '*.md'
# Allow manual trigger
workflow_dispatch:
inputs:
tag:
description: 'Docker tag (e.g., v1.5.0 or latest)'
required: true
default: 'manual'
include_latest:
description: 'Also tag as latest'
required: false
default: false
type: boolean
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: Install dependencies
run: npm install
- name: Create config file
run: |
if [ ! -f config/config.json ]; then
cp config/config.json.example config/config.json
fi
- name: Run tests
run: npm test
env:
NODE_ENV: test
build:
runs-on: ubuntu-latest
needs: test # Only run if tests pass
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.7
- name: Docker Setup QEMU
uses: docker/setup-qemu-action@v3.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.6.1
- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
- name: Determine Docker tags
id: docker_tags
run: |
SHORT_SHA="${GITHUB_SHA::7}"
if [ "${{ github.event_name }}" = "release" ]; then
# Release: tag with version and latest
VERSION="${{ github.event.release.tag_name }}"
# Remove 'v' prefix if present for semver tag
SEMVER="${VERSION#v}"
echo "tags=${{ secrets.DOCKERHUB_USERNAME }}/slackonos:latest,${{ secrets.DOCKERHUB_USERNAME }}/slackonos:${VERSION},${{ secrets.DOCKERHUB_USERNAME }}/slackonos:${SEMVER}" >> $GITHUB_OUTPUT
echo "is_release=true" >> $GITHUB_OUTPUT
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "github_ref=refs/tags/${VERSION}" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
# Manual trigger
TAG="${{ github.event.inputs.tag }}"
if [ "${{ github.event.inputs.include_latest }}" = "true" ]; then
echo "tags=${{ secrets.DOCKERHUB_USERNAME }}/slackonos:latest,${{ secrets.DOCKERHUB_USERNAME }}/slackonos:${TAG},${{ secrets.DOCKERHUB_USERNAME }}/slackonos:${TAG}-${SHORT_SHA}" >> $GITHUB_OUTPUT
echo "is_release=true" >> $GITHUB_OUTPUT
echo "github_ref=refs/tags/${TAG}" >> $GITHUB_OUTPUT
else
echo "tags=${{ secrets.DOCKERHUB_USERNAME }}/slackonos:${TAG},${{ secrets.DOCKERHUB_USERNAME }}/slackonos:${TAG}-${SHORT_SHA}" >> $GITHUB_OUTPUT
echo "is_release=false" >> $GITHUB_OUTPUT
echo "github_ref=" >> $GITHUB_OUTPUT
fi
else
# Develop branch
echo "tags=${{ secrets.DOCKERHUB_USERNAME }}/slackonos:develop,${{ secrets.DOCKERHUB_USERNAME }}/slackonos:develop-${SHORT_SHA}" >> $GITHUB_OUTPUT
echo "is_release=false" >> $GITHUB_OUTPUT
echo "github_ref=" >> $GITHUB_OUTPUT
fi
- name: Build and push multi-platform Docker image
uses: docker/build-push-action@v6.7.0
with:
context: .
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ steps.docker_tags.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
GITHUB_REF=${{ steps.docker_tags.outputs.github_ref }}
- name: Verify the platforms
run: docker buildx inspect --bootstrap
- name: Create GitHub Release Summary
if: github.event_name == 'release'
run: |
echo "## 🐳 Docker Image Published" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Version:** ${{ github.event.release.tag_name }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Pull commands:**" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
echo "docker pull ${{ secrets.DOCKERHUB_USERNAME }}/slackonos:latest" >> $GITHUB_STEP_SUMMARY
echo "docker pull ${{ secrets.DOCKERHUB_USERNAME }}/slackonos:${{ github.event.release.tag_name }}" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY