Skip to content

Consolidate github actions to prevent duplication #79

Consolidate github actions to prevent duplication

Consolidate github actions to prevent duplication #79

Workflow file for this run

name: Master Server Build and Push
on:
push:
branches:
- master
paths:
- "server/**"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/server-push.yml"
jobs:
server-build-and-push:
strategy:
matrix:
include:
- runner: ubuntu-latest
platform: linux/amd64
arch: amd64
- runner: ubuntu-24.04-arm
platform: linux/arm64
arch: arm64
runs-on: ${{ matrix.runner }}
steps:
- name: πŸ— Checkout code
uses: actions/checkout@v4
- name: πŸ‹ Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: πŸ” Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: πŸš€ Build and push ${{ matrix.arch }}
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform }}
push: true
tags: ghcr.io/blixtwallet/noah-server:latest-${{ matrix.arch }}
cache-from: type=gha,scope=${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=${{ matrix.arch }}
create-manifest:
needs: server-build-and-push
runs-on: ubuntu-latest
steps:
- name: πŸ” Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🎯 Create and push multi-arch manifest
run: |
docker buildx imagetools create -t ghcr.io/blixtwallet/noah-server:latest \
ghcr.io/blixtwallet/noah-server:latest-amd64 \
ghcr.io/blixtwallet/noah-server:latest-arm64