Skip to content

Commit e237477

Browse files
committed
uses .zip instead of .tar.gz files
This allows using the official .zip and its related checksums (SHA512). Also: * Adds optional manual build * Build for both linux/amd64 and linux/arm64 in parallel * Publish the image to GitHub Container Registry (ghcr.io) instead of docker
1 parent 871047b commit e237477

2 files changed

Lines changed: 41 additions & 14 deletions

File tree

.github/workflows/dockerimage.yml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,48 @@ on:
44
schedule:
55
- cron: "20 19 * * *"
66

7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
inputs:
10+
BUILD_VERSION:
11+
description: 'Build version'
12+
required: true
13+
default: '1839'
14+
BUILD_SHA512SUM:
15+
description: 'SHA512 hash'
16+
required: true
17+
default: '7266fb1613adbe0d652497aa189fb1ab5d80fe7da7182c4365dd54f71c0f3248b750400a5049f2a63ab18df2ea4a7fad981ba7f3a1b24e5760adea76d1a527ca'
18+
719
jobs:
820
build:
921
runs-on: ubuntu-latest
1022
env:
11-
BUILD_VERSION: 1822
12-
BUILD_SHA1SUM: c84341b409672d3617300a0348fc81ff21453433
23+
BUILD_AUTHORS: "Kane 'kawaii' Valentine <kawaii@mybb.com>"
24+
BUILD_VERSION: ${{ github.event.inputs.BUILD_VERSION }}
25+
BUILD_SHA512SUM: ${{ github.event.inputs.BUILD_SHA512SUM }}
1326

1427
steps:
1528
- uses: actions/checkout@v2
16-
- name: Build the Docker image
29+
30+
- name: Set up Docker Buildx
31+
uses: docker/setup-buildx-action@v3
32+
33+
- name: Log in to GHCR
34+
uses: docker/login-action@v3
35+
with:
36+
registry: ghcr.io
37+
username: ${{ github.actor }}
38+
password: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Build multi-arch Docker image
1741
run: |
18-
docker build \
19-
--build-arg BUILD_AUTHORS="Kane 'kawaii' Valentine <kawaii@mybb.com>" \
42+
docker buildx build \
43+
--platform linux/amd64,linux/arm64 \
44+
--build-arg BUILD_AUTHORS="$BUILD_AUTHORS" \
2045
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
21-
--build-arg BUILD_SHA1SUM=$BUILD_SHA1SUM \
46+
--build-arg BUILD_SHA512SUM=$BUILD_SHA512SUM \
2247
--build-arg BUILD_VERSION=$BUILD_VERSION \
23-
--tag mybb/mybb:$BUILD_VERSION \
24-
--tag mybb/mybb:latest \
48+
--tag ghcr.io/mybb/mybb:$BUILD_VERSION \
49+
--tag ghcr.io/mybb/mybb:latest \
50+
--push \
2551
$PWD

Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,15 @@ RUN { \
7272
echo 'memory_limit=256M'; \
7373
} > /usr/local/etc/php/conf.d/mybb-recommended.ini
7474

75-
ENV MYBB_VERSION $BUILD_VERSION
76-
ENV MYBB_SHA512 $BUILD_SHA512SUM
75+
ENV MYBB_VERSION=$BUILD_VERSION
76+
ENV MYBB_SHA512=$BUILD_SHA512SUM
7777

7878
RUN set -ex; \
79-
curl -o mybb.tar.gz -fSL "https://github.com/mybb/mybb/archive/refs/tags/mybb_${MYBB_VERSION}.tar.gz"; \
80-
echo "$MYBB_SHA512 *mybb.tar.gz" | sha512sum -c -; \
81-
tar -xzf mybb.tar.gz -C /usr/src/; \
82-
rm mybb.tar.gz; \
79+
curl -o mybb.zip -fSL "https://github.com/mybb/mybb/releases/download/mybb_1839/mybb_${MYBB_VERSION}.zip"; \
80+
echo "$MYBB_SHA512 *mybb.zip" | sha512sum -c -; \
81+
unzip mybb.zip; \
82+
mv Upload /usr/src/mybb-mybb_${MYBB_VERSION}; \
83+
rm -rf mybb.zip Documentation; \
8384
chown -R www-data:www-data /usr/src/mybb-mybb_${MYBB_VERSION}
8485

8586
COPY docker-entrypoint.sh /usr/local/bin/

0 commit comments

Comments
 (0)