Skip to content

Version 0.1.1

Version 0.1.1 #189

Workflow file for this run

name: Master Server Build and Push
on:
push:
branches:
- master
tags:
- "v*"
paths:
- "server/**"
- "fly/**"
- "Cargo.toml"
- "Cargo.lock"
- "Dockerfile"
- ".github/workflows/**"
- "!**/*.md"
jobs:
server-build-and-push:
strategy:
matrix:
include:
- runner: blacksmith-4vcpu-ubuntu-2404
platform: linux/amd64
arch: amd64
- runner: blacksmith-4vcpu-ubuntu-2404-arm
platform: linux/arm64
arch: arm64
runs-on: ${{ matrix.runner }}
steps:
- name: πŸ— Checkout code
uses: actions/checkout@v6
- name: Setup Blacksmith Builder
uses: useblacksmith/setup-docker-builder@v1
- name: πŸ” Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: πŸ” Login to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: πŸš€ Build and push ${{ matrix.arch }}
uses: useblacksmith/build-push-action@v2
with:
context: .
platforms: ${{ matrix.platform }}
push: true
tags: |
ghcr.io/smolcars/noah-server:latest-${{ matrix.arch }}
${{ secrets.DOCKERHUB_USERNAME }}/noah-server:latest-${{ matrix.arch }}
create-manifest:
needs: server-build-and-push
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: πŸ” Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: πŸ” Login to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: 🎯 Create and push multi-arch manifest
run: |
docker buildx imagetools create -t ghcr.io/smolcars/noah-server:latest \
ghcr.io/smolcars/noah-server:latest-amd64 \
ghcr.io/smolcars/noah-server:latest-arm64
docker buildx imagetools create -t ${{ secrets.DOCKERHUB_USERNAME }}/noah-server:latest \
${{ secrets.DOCKERHUB_USERNAME }}/noah-server:latest-amd64 \
${{ secrets.DOCKERHUB_USERNAME }}/noah-server:latest-arm64
fly-deploy:
name: Deploy to Fly
needs: create-manifest
runs-on: blacksmith-4vcpu-ubuntu-2404
concurrency: deploy-group
steps:
- uses: actions/checkout@v6
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --config fly/signet.fly.toml --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_SIGNET_API_TOKEN }}
mainnet-fly-deploy:
name: Deploy mainnet to Fly
needs: fly-deploy
if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
runs-on: blacksmith-4vcpu-ubuntu-2404
environment: production
concurrency: fly-mainnet-deploy
steps:
- uses: actions/checkout@v6
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl config validate --strict --config fly/mainnet.fly.toml
env:
FLY_API_TOKEN: ${{ secrets.FLY_MAINNET_API_TOKEN }}
- run: flyctl deploy --config fly/mainnet.fly.toml --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_MAINNET_API_TOKEN }}