Skip to content

Merge pull request #3 from WasinUddy/Implement-K8S-health-probe #33

Merge pull request #3 from WasinUddy/Implement-K8S-health-probe

Merge pull request #3 from WasinUddy/Implement-K8S-health-probe #33

name: Build Montainer (Preview) Image
on:
push:
paths:
- 'Dockerfile'
- 'versions/preview.txt'
- '.github/workflows/build-montainer-preview-image.yaml'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true # Stop all jobs if one fails
matrix:
platform:
- linux/amd64
steps:
- name: Echo Platform
run: |
platform=${{ matrix.platform }}
echo "Platform: $platform"
echo "PLATFORM=$platform" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Set up Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Download and Extract Minecraft Server
run: |
python3 -m pip install --upgrade pip
python3 -m pip install requests==2.31.0
python3 scripts/download_minecraft_server.py --type=preview
- name: Build frontend web static
run: |
cd web/frontend
npm install
npm run build
- name: Fetch Versions
run: |
echo "PREVIEW_VERSION=$(cat versions/preview.txt)" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PAT }}
- name: Build Montainer (preview) Image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
ARCH=${{ matrix.platform }}
tags: |
ghcr.io/wasinuddy/montainer-preview:latest
ghcr.io/wasinuddy/montainer-preview:${{ env.PREVIEW_VERSION }}
platforms: ${{ matrix.platform }}