Skip to content

Commit 1266aca

Browse files
authored
feat(docker): publish images for both arm64 as amd64 (#354)
Additionally, update the GitHub workflows to be a bit more modern. A lot of tricks that were needed "in the old days" have much better alternatives these days.
1 parent cd15862 commit 1266aca

6 files changed

Lines changed: 53 additions & 157 deletions

File tree

.github/workflows/commit-checker.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/deployment.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 0 additions & 72 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
release:
8+
types:
9+
- published
10+
11+
jobs:
12+
publish_image:
13+
name: Publish image
14+
uses: OpenTTD/actions/.github/workflows/publish-image.yml@v3
15+
16+
deploy:
17+
name: Deploy
18+
needs:
19+
- publish_image
20+
21+
uses: OpenTTD/actions/.github/workflows/aws-deployment.yml@v3
22+
with:
23+
is_staging: ${{ github.ref == 'refs/heads/main' }}
24+
name: Wiki
25+
url_production: https://wiki.openttd.org
26+
url_staging: https://wiki.staging.openttd.org
27+
digest: ${{ needs.publish_image.outputs.digest }}
28+
version: ${{ needs.publish_image.outputs.version }}
29+
secrets:
30+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
31+
AWS_REGION: ${{ secrets.AWS_REGION }}
32+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

.github/workflows/testing.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,52 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v3
1818
- name: Set up Python 3.8
19-
uses: actions/setup-python@v1
19+
uses: actions/setup-python@v4
2020
with:
2121
python-version: 3.8
2222
- name: Install dependencies
2323
run: python -m pip install -r requirements.txt
2424
- name: Initialize CodeQL
25-
uses: github/codeql-action/init@v1
25+
uses: github/codeql-action/init@v2
2626
with:
2727
languages: python
2828
queries: security-and-quality
2929
- name: Perform CodeQL Analysis
30-
uses: github/codeql-action/analyze@v1
30+
uses: github/codeql-action/analyze@v2
3131

3232
docker:
3333
name: Docker build
3434
runs-on: ubuntu-latest
3535
steps:
3636
- name: Checkout
37-
uses: actions/checkout@v2
37+
uses: actions/checkout@v3
38+
- name: Setup QEMU
39+
uses: docker/setup-qemu-action@v2
40+
- name: Setup Docker Buildx
41+
uses: docker/setup-buildx-action@v2
3842
- name: Build
39-
run: docker build .
43+
uses: docker/build-push-action@v3
44+
with:
45+
context: .
46+
platforms: linux/amd64,linux/arm64
47+
push: false
48+
cache-from: type=gha
49+
cache-to: type=gha,mode=max
4050

4151
flake8:
4252
name: Flake8
4353
runs-on: ubuntu-latest
4454
steps:
4555
- name: Checkout
46-
uses: actions/checkout@v2
56+
uses: actions/checkout@v3
4757
- name: Flake8
48-
uses: TrueBrain/actions-flake8@v1
58+
uses: TrueBrain/actions-flake8@v2
4959
with:
5060
path: truewiki
5161
- name: Flake8
52-
uses: TrueBrain/actions-flake8@v1
62+
uses: TrueBrain/actions-flake8@v2
5363
with:
5464
path: e2e
5565

@@ -58,9 +68,9 @@ jobs:
5868
runs-on: ubuntu-latest
5969
steps:
6070
- name: Checkout
61-
uses: actions/checkout@v2
71+
uses: actions/checkout@v3
6272
- name: Set up Python 3.8
63-
uses: actions/setup-python@v1
73+
uses: actions/setup-python@v4
6474
with:
6575
python-version: 3.8
6676
- name: Set up packages

Dockerfile

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
11
FROM python:3.8-slim
22

3-
ARG BUILD_DATE=""
43
ARG BUILD_VERSION="dev"
54

6-
LABEL maintainer="TrueBrain <truebrain@truebrain.nl>"
7-
LABEL org.opencontainers.image.created=${BUILD_DATE}
8-
LABEL org.opencontainers.image.authors="TrueBrain <truebrain@truebrain.nl>"
9-
LABEL org.opencontainers.image.url="https://github.com/TrueBrain/TrueWiki"
10-
LABEL org.opencontainers.image.source="https://github.com/TrueBrain/TrueWiki"
11-
LABEL org.opencontainers.image.version=${BUILD_VERSION}
12-
LABEL org.opencontainers.image.licenses="AGPLv3"
13-
LABEL org.opencontainers.image.title="Wiki Server"
14-
LABEL org.opencontainers.image.description="TrueWiki is a wikitext server similar to mediawiki and gollum"
15-
165
# git is needed to clone the wiki data
176
# openssh-client is needed to git clone over ssh
187
RUN apt-get update && apt-get install -y --no-install-recommends \

0 commit comments

Comments
 (0)