-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into database-sessions
- Loading branch information
Showing
527 changed files
with
31,829 additions
and
12,905 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
#!/bin/bash -x | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
# Non-pushing PR | ||
GITHUB_OUTPUT=/dev/stdout \ | ||
GITHUB_REF=ref \ | ||
GITHUB_SHA=sha \ | ||
IMAGE_NAME=ghcr.io/goauthentik/server,beryju/authentik \ | ||
GITHUB_REPOSITORY=goauthentik/authentik \ | ||
python $SCRIPT_DIR/push_vars.py | ||
|
||
# Pushing PR/main | ||
GITHUB_OUTPUT=/dev/stdout \ | ||
GITHUB_REF=ref \ | ||
GITHUB_SHA=sha \ | ||
IMAGE_NAME=ghcr.io/goauthentik/server,beryju/authentik \ | ||
GITHUB_REPOSITORY=goauthentik/authentik \ | ||
DOCKER_USERNAME=foo \ | ||
python $SCRIPT_DIR/push_vars.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# Re-usable workflow for a single-architecture build | ||
name: Single-arch Container build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
image_name: | ||
required: true | ||
type: string | ||
image_arch: | ||
required: true | ||
type: string | ||
runs-on: | ||
required: true | ||
type: string | ||
registry_dockerhub: | ||
default: false | ||
type: boolean | ||
registry_ghcr: | ||
default: false | ||
type: boolean | ||
release: | ||
default: false | ||
type: boolean | ||
outputs: | ||
image-digest: | ||
value: ${{ jobs.build.outputs.image-digest }} | ||
|
||
jobs: | ||
build: | ||
name: Build ${{ inputs.image_arch }} | ||
runs-on: ${{ inputs.runs-on }} | ||
outputs: | ||
image-digest: ${{ steps.push.outputs.digest }} | ||
permissions: | ||
# Needed to upload container images to ghcr.io | ||
packages: write | ||
# Needed for attestation | ||
id-token: write | ||
attestations: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/[email protected] | ||
- uses: docker/setup-buildx-action@v3 | ||
- name: prepare variables | ||
uses: ./.github/actions/docker-push-variables | ||
id: ev | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
with: | ||
image-name: ${{ inputs.image_name }} | ||
image-arch: ${{ inputs.image_arch }} | ||
release: ${{ inputs.release }} | ||
- name: Login to Docker Hub | ||
if: ${{ inputs.registry_dockerhub }} | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: ${{ inputs.registry_ghcr }} | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: make empty clients | ||
if: ${{ inputs.release }} | ||
run: | | ||
mkdir -p ./gen-ts-api | ||
mkdir -p ./gen-go-api | ||
- name: generate ts client | ||
if: ${{ !inputs.release }} | ||
run: make gen-client-ts | ||
- name: Build Docker Image | ||
uses: docker/build-push-action@v6 | ||
id: push | ||
with: | ||
context: . | ||
push: ${{ steps.ev.outputs.shouldPush == 'true' }} | ||
secrets: | | ||
GEOIPUPDATE_ACCOUNT_ID=${{ secrets.GEOIPUPDATE_ACCOUNT_ID }} | ||
GEOIPUPDATE_LICENSE_KEY=${{ secrets.GEOIPUPDATE_LICENSE_KEY }} | ||
build-args: | | ||
${{ steps.ev.outputs.imageBuildArgs }} | ||
tags: ${{ steps.ev.outputs.imageTags }} | ||
platforms: linux/${{ inputs.image_arch }} | ||
cache-from: type=registry,ref=${{ steps.ev.outputs.attestImageNames }}:buildcache-${{ inputs.image_arch }} | ||
cache-to: ${{ steps.ev.outputs.cacheTo }} | ||
- uses: actions/attest-build-provenance@v2 | ||
id: attest | ||
if: ${{ steps.ev.outputs.shouldPush == 'true' }} | ||
with: | ||
subject-name: ${{ steps.ev.outputs.attestImageNames }} | ||
subject-digest: ${{ steps.push.outputs.digest }} | ||
push-to-registry: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# Re-usable workflow for a multi-architecture build | ||
name: Multi-arch container build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
image_name: | ||
required: true | ||
type: string | ||
registry_dockerhub: | ||
default: false | ||
type: boolean | ||
registry_ghcr: | ||
default: true | ||
type: boolean | ||
release: | ||
default: false | ||
type: boolean | ||
outputs: {} | ||
|
||
jobs: | ||
build-server-amd64: | ||
uses: ./.github/workflows/_reusable-docker-build-single.yaml | ||
secrets: inherit | ||
with: | ||
image_name: ${{ inputs.image_name }} | ||
image_arch: amd64 | ||
runs-on: ubuntu-latest | ||
registry_dockerhub: ${{ inputs.registry_dockerhub }} | ||
registry_ghcr: ${{ inputs.registry_ghcr }} | ||
release: ${{ inputs.release }} | ||
build-server-arm64: | ||
uses: ./.github/workflows/_reusable-docker-build-single.yaml | ||
secrets: inherit | ||
with: | ||
image_name: ${{ inputs.image_name }} | ||
image_arch: arm64 | ||
runs-on: ubuntu-22.04-arm | ||
registry_dockerhub: ${{ inputs.registry_dockerhub }} | ||
registry_ghcr: ${{ inputs.registry_ghcr }} | ||
release: ${{ inputs.release }} | ||
get-tags: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build-server-amd64 | ||
- build-server-arm64 | ||
outputs: | ||
tags: ${{ steps.ev.outputs.imageTagsJSON }} | ||
shouldPush: ${{ steps.ev.outputs.shouldPush }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: prepare variables | ||
uses: ./.github/actions/docker-push-variables | ||
id: ev | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
with: | ||
image-name: ${{ inputs.image_name }} | ||
merge-server: | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.get-tags.outputs.shouldPush == 'true' }} | ||
needs: | ||
- get-tags | ||
- build-server-amd64 | ||
- build-server-arm64 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
tag: ${{ fromJson(needs.get-tags.outputs.tags) }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: prepare variables | ||
uses: ./.github/actions/docker-push-variables | ||
id: ev | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
with: | ||
image-name: ${{ inputs.image_name }} | ||
- name: Login to Docker Hub | ||
if: ${{ inputs.registry_dockerhub }} | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: ${{ inputs.registry_ghcr }} | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: int128/docker-manifest-create-action@v2 | ||
id: build | ||
with: | ||
tags: ${{ matrix.tag }} | ||
sources: | | ||
${{ steps.ev.outputs.attestImageNames }}@${{ needs.build-server-amd64.outputs.image-digest }} | ||
${{ steps.ev.outputs.attestImageNames }}@${{ needs.build-server-arm64.outputs.image-digest }} | ||
- uses: actions/attest-build-provenance@v2 | ||
id: attest | ||
with: | ||
subject-name: ${{ steps.ev.outputs.attestImageNames }} | ||
subject-digest: ${{ steps.build.outputs.digest }} | ||
push-to-registry: true |
Oops, something went wrong.