-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (66 loc) · 2.43 KB
/
build-montainer-stable-image.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Build Montainer (Stable) Image
on:
push:
paths:
- 'Dockerfile'
- 'versions/stable.txt'
- '.github/workflows/build-montainer-stable-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=stable
- name: Build frontend web static
run: |
cd web/frontend
npm install
npm run build
- name: Fetch Versions
run: |
echo "STABLE_VERSION=$(cat versions/stable.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 (Stable) Image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
ARCH=${{ matrix.platform }}
tags: |
ghcr.io/wasinuddy/montainer-stable:latest
ghcr.io/wasinuddy/montainer-stable:${{ env.STABLE_VERSION }}
platforms: ${{ matrix.platform }}