Skip to content

Commit bf72bd9

Browse files
Integrate the crossfire-server version into the docker iamge
1 parent 26dc33d commit bf72bd9

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed
Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,40 @@ on:
1313
- devcontainer
1414

1515
jobs:
16+
lint:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Lint Dockerfile
24+
uses: hadolint/[email protected]
25+
with:
26+
dockerfile: Dockerfile
27+
28+
lint-devcontainer:
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Lint Dockerfile
36+
uses: hadolint/[email protected]
37+
with:
38+
dockerfile: .devcontainer/Dockerfile
39+
1640
build-and-push:
1741
runs-on: ubuntu-latest
18-
name: Build Docker Image
1942

2043
# strategy:
2144
# matrix:
2245
# platform: [linux/amd64, linux/arm64]
2346

47+
needs: lint
48+
if: ${{ success() }}
49+
2450
steps:
2551
- name: Checkout
2652
uses: actions/checkout@v4
@@ -37,6 +63,14 @@ jobs:
3763
username: ${{ secrets.DOCKERHUB_USERNAME }}
3864
password: ${{ secrets.DOCKERHUB_TOKEN }}
3965

66+
- name: Get crossfire-server version from APT
67+
id: crossfire
68+
run: |
69+
sudo apt-get update -qq
70+
VERSION=$(apt-cache policy crossfire-server | grep Candidate | awk '{print $2}')
71+
echo "Crossfire server version: $VERSION"
72+
echo "version=$VERSION" >> $GITHUB_OUTPUT
73+
4074
- name: Build and Push
4175
uses: docker/build-push-action@v6
4276
with:
@@ -46,6 +80,7 @@ jobs:
4680
tags: |
4781
basictheprogram/crossfire-server:latest
4882
basictheprogram/crossfire-server:${{ github.sha }}
83+
basictheprogram/crossfire-server:${{ steps.crossfire.outputs.version }}
4984
cache-from: type=gha
5085
cache-to: type=gha,mode=max
5186

0 commit comments

Comments
 (0)