Compare commits
2 commits
c9837a6bd4
...
e6488162c8
Author | SHA1 | Date | |
---|---|---|---|
Lea | e6488162c8 | ||
Lea | 0304ec657a |
50
.forgejo/workflows/docker-build.yml
Normal file
50
.forgejo/workflows/docker-build.yml
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
name: Docker Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "master"
|
||||||
|
tags:
|
||||||
|
- "*"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish_api:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
-
|
||||||
|
name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: actions/docker-metadata-action@v4
|
||||||
|
with:
|
||||||
|
# list of Docker images to use as base name for tags
|
||||||
|
images: git.amogus.cloud/lea/maddy-admin
|
||||||
|
# generate Docker tags based on branch and short commit SHA
|
||||||
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
|
type=sha
|
||||||
|
-
|
||||||
|
name: Set up QEMU
|
||||||
|
uses: actions/docker-setup-qemu-action@v2
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: actions/docker-setup-buildx-action@v2
|
||||||
|
-
|
||||||
|
name: Login to registry
|
||||||
|
uses: actions/docker-login-action@v2
|
||||||
|
with:
|
||||||
|
registry: git.amogus.cloud
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
-
|
||||||
|
name: Build and push
|
||||||
|
uses: actions/docker-build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./api/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
|
@ -1,5 +1,5 @@
|
||||||
import apiAuth from "@/lib/apiAuth";
|
import apiAuth from "@/lib/apiAuth";
|
||||||
import { auditLog } from "@/lib/audit";
|
import { auditLogRaw } from "@/lib/audit";
|
||||||
import { AliasEntry, createAliasEntry } from "@/lib/db";
|
import { AliasEntry, createAliasEntry } from "@/lib/db";
|
||||||
import { generateAliasEmail } from "@/lib/util-server";
|
import { generateAliasEmail } from "@/lib/util-server";
|
||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
|
@ -72,7 +72,12 @@ export async function POST(request: Request) {
|
||||||
temporary: true,
|
temporary: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
auditLog("createTempAlias", alias);
|
await auditLogRaw({
|
||||||
|
action: "createTempAlias",
|
||||||
|
ts: new Date().toISOString(),
|
||||||
|
data: alias,
|
||||||
|
user: user,
|
||||||
|
});
|
||||||
return NextResponse.json(alias);
|
return NextResponse.json(alias);
|
||||||
});
|
});
|
||||||
}
|
}
|
Loading…
Reference in a new issue