-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 1.89 KB
/
build-montainer-preview-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
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
steps:
# Checkout the code from GitHub repository
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
- 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: Login to ghcr.io
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
tags: |
ghcr.io/wasinuddy/montainer-preview:latest
ghcr.io/wasinuddy/montainer-preview:${{ env.PREVIEW_VERSION }}
platforms: linux/amd64