Skip to content

Commit

Permalink
feat(docker): publish images for both arm64 as amd64 (#354)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TrueBrain committed Aug 7, 2022
1 parent cd15862 commit 1266aca
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 157 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/commit-checker.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/deployment.yml

This file was deleted.

72 changes: 0 additions & 72 deletions .github/workflows/publish.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,32 @@
name: Release

on:
push:
branches:
- main
release:
types:
- published

jobs:
publish_image:
name: Publish image
uses: OpenTTD/actions/.github/workflows/publish-image.yml@v3

deploy:
name: Deploy
needs:
- publish_image

uses: OpenTTD/actions/.github/workflows/aws-deployment.yml@v3
with:
is_staging: ${{ github.ref == 'refs/heads/main' }}
name: Wiki
url_production: https://wiki.openttd.org
url_staging: https://wiki.staging.openttd.org
digest: ${{ needs.publish_image.outputs.digest }}
version: ${{ needs.publish_image.outputs.version }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
32 changes: 21 additions & 11 deletions .github/workflows/testing.yml
Expand Up @@ -14,42 +14,52 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: python -m pip install -r requirements.txt
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: python
queries: security-and-quality
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2

docker:
name: Docker build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
run: docker build .
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: false
cache-from: type=gha
cache-to: type=gha,mode=max

flake8:
name: Flake8
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Flake8
uses: TrueBrain/actions-flake8@v1
uses: TrueBrain/actions-flake8@v2
with:
path: truewiki
- name: Flake8
uses: TrueBrain/actions-flake8@v1
uses: TrueBrain/actions-flake8@v2
with:
path: e2e

Expand All @@ -58,9 +68,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Set up packages
Expand Down
11 changes: 0 additions & 11 deletions Dockerfile
@@ -1,18 +1,7 @@
FROM python:3.8-slim

ARG BUILD_DATE=""
ARG BUILD_VERSION="dev"

LABEL maintainer="TrueBrain <truebrain@truebrain.nl>"
LABEL org.opencontainers.image.created=${BUILD_DATE}
LABEL org.opencontainers.image.authors="TrueBrain <truebrain@truebrain.nl>"
LABEL org.opencontainers.image.url="https://github.com/TrueBrain/TrueWiki"
LABEL org.opencontainers.image.source="https://github.com/TrueBrain/TrueWiki"
LABEL org.opencontainers.image.version=${BUILD_VERSION}
LABEL org.opencontainers.image.licenses="AGPLv3"
LABEL org.opencontainers.image.title="Wiki Server"
LABEL org.opencontainers.image.description="TrueWiki is a wikitext server similar to mediawiki and gollum"

# git is needed to clone the wiki data
# openssh-client is needed to git clone over ssh
RUN apt-get update && apt-get install -y --no-install-recommends \
Expand Down

0 comments on commit 1266aca

Please sign in to comment.