Skip to content

Commit 6424681

Browse files
committed
feat: update koa, deps & workflows
1 parent 66c144e commit 6424681

File tree

8 files changed

+1184
-579
lines changed

8 files changed

+1184
-579
lines changed

.github/dependabot.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Docs: <https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/customizing-dependency-updates>
2+
3+
version: 2
4+
5+
updates:
6+
- package-ecosystem: gomod
7+
directory: /
8+
schedule: { interval: monthly }
9+
10+
- package-ecosystem: github-actions
11+
directory: /
12+
schedule: { interval: monthly }
13+
14+
- package-ecosystem: docker
15+
directory: /
16+
schedule: { interval: monthly }
17+
18+
- package-ecosystem: docker
19+
directory: /proto/
20+
schedule: { interval: monthly }
21+
22+
- package-ecosystem: npm
23+
directory: /website
24+
schedule: { interval: monthly }
25+
26+
- package-ecosystem: pip
27+
directory: /
28+
schedule: { interval: monthly }

.github/workflows/build.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build Docker image
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: ${{ github.repository }}
13+
14+
permissions:
15+
contents: read
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
22+
23+
- name: Set up QEMU
24+
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
28+
with:
29+
buildkitd-config: .github/buildkitd.toml
30+
31+
- name: Retrieve author data
32+
id: author
33+
run: |
34+
AUTHOR=$(curl -sSL ${{ github.event.repository.owner.url }} | jq -r '.name')
35+
echo "AUTHOR=$AUTHOR" >> $GITHUB_ENV
36+
37+
- name: Extract metadata (tags, labels) for Docker
38+
id: meta
39+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
40+
with:
41+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
42+
labels: |
43+
org.opencontainers.image.authors=${{ env.AUTHOR }}
44+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
45+
org.opencontainers.image.created=${{ steps.meta.outputs.created }}
46+
47+
- name: Build Docker image
48+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
49+
with:
50+
context: .
51+
platforms: linux/amd64
52+
push: false
53+
load: true
54+
cache-from: type=gha
55+
cache-to: type=gha,mode=max
56+
tags: ${{ steps.meta.outputs.tags }}
57+
labels: ${{ steps.meta.outputs.labels }}
58+
build-args: |
59+
VERSION=${{ github.head_ref || github.ref_name }}
60+
COMMIT=${{ github.sha }}
61+
62+
- name: Inspect Docker image
63+
run: docker image inspect ${{ steps.meta.outputs.tags }}

.github/workflows/hooks.yml

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

.github/workflows/publish.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Publish Docker image
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
tags:
9+
- "v*.*.*"
10+
11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_NAME: ${{ github.repository }}
14+
15+
jobs:
16+
push_to_registry:
17+
name: Push Docker image to GitHub Packages
18+
runs-on: ubuntu-latest
19+
permissions:
20+
packages: write
21+
contents: read
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
25+
26+
- name: Set up QEMU
27+
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
28+
with:
29+
platforms: all
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
33+
with:
34+
buildkitd-config: .github/buildkitd.toml
35+
36+
- name: Login to GitHub Container Registry
37+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
38+
with:
39+
registry: ${{ env.REGISTRY }}
40+
username: ${{ github.actor }}
41+
password: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Retrieve author data
44+
id: author
45+
run: |
46+
AUTHOR=$(curl -sSL ${{ github.event.repository.owner.url }} | jq -r '.name')
47+
echo "AUTHOR=$AUTHOR" >> $GITHUB_ENV
48+
49+
- name: Set up environment
50+
run: |
51+
echo "TAG_NAME=" >> $GITHUB_ENV
52+
if [[ "${GITHUB_REF##*/}" == "main" ]]; then
53+
echo "TAG_NAME=main" >> $GITHUB_ENV
54+
elif [[ "${GITHUB_REF##*/}" == "master" ]]; then
55+
echo "TAG_NAME=master" >> $GITHUB_ENV
56+
fi
57+
58+
- name: Extract metadata (tags, labels) for Docker
59+
id: meta
60+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
61+
with:
62+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
63+
tags: |
64+
type=raw,value=${{ env.TAG_NAME }}
65+
type=ref,event=branch
66+
type=ref,event=tag
67+
type=sha,prefix=sha-
68+
labels: |
69+
org.opencontainers.image.authors=${{ env.AUTHOR }}
70+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
71+
org.opencontainers.image.created=${{ steps.meta.outputs.created }}
72+
73+
- name: Build and push container image
74+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
75+
with:
76+
context: .
77+
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/ppc64le,linux/s390x
78+
push: true
79+
cache-from: type=gha
80+
cache-to: type=gha,mode=max
81+
tags: ${{ steps.meta.outputs.tags }}
82+
labels: ${{ steps.meta.outputs.labels }}
83+
build-args: |
84+
VERSION=${{ github.head_ref || github.ref_name }}
85+
COMMIT=${{ github.sha }}

Dockerfile

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,4 @@ RUN set -ex; \
1313

1414
COPY views /app/views
1515

16-
CMD ["node", "/app/index"]
17-
18-
# Arguments to label built container
19-
ARG VCS_REF=unknown
20-
ARG BUILD_DATE=unknown
21-
ARG VERSION=1.4.0
22-
23-
# Container labels (http://label-schema.org/)
24-
# Container annotations (https://github.com/opencontainers/image-spec)
25-
LABEL maintainer="Monogramm Maintainers <opensource at monogramm dot io>" \
26-
product="Autodiscover Email Settings" \
27-
version=$VERSION \
28-
org.label-schema.vcs-ref=$VCS_REF \
29-
org.label-schema.vcs-url="https://github.com/Monogramm/autodiscover-email-settings" \
30-
org.label-schema.build-date=$BUILD_DATE \
31-
org.label-schema.name="Autodiscover Email Settings" \
32-
org.label-schema.description="Provides Autodiscover capabilities for IMAP/POP/SMTP/LDAP services on Microsoft Outlook/Apple Mail and Autoconfig capabilities for Thunderbird" \
33-
org.label-schema.url="https://github.com/Monogramm/autodiscover-email-settings" \
34-
org.label-schema.vendor="Monogramm" \
35-
org.label-schema.version=$VERSION \
36-
org.label-schema.schema-version="1.0" \
37-
org.opencontainers.image.revision=$VCS_REF \
38-
org.opencontainers.image.source="https://github.com/Monogramm/autodiscover-email-settings" \
39-
org.opencontainers.image.created=$BUILD_DATE \
40-
org.opencontainers.image.title="Autodiscover Email Settings" \
41-
org.opencontainers.image.description="Provides Autodiscover capabilities for IMAP/POP/SMTP/LDAP services on Microsoft Outlook/Apple Mail and Autoconfig capabilities for Thunderbird" \
42-
org.opencontainers.image.url="https://github.com/Monogramm/autodiscover-email-settings" \
43-
org.opencontainers.image.vendor="Monogramm" \
44-
org.opencontainers.image.version=$VERSION \
45-
org.opencontainers.image.authors="Monogramm Maintainers <opensource at monogramm dot io>"
16+
CMD ["node", "/app/index"]

0 commit comments

Comments
 (0)