Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- self-hosted
- Linux
- ${{ matrix.runner }}

strategy:
matrix:
cpu: [arm64, amd64]
Expand All @@ -31,23 +32,31 @@ jobs:
- cpu: amd64
runner: X64
tag: amd64

permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Login to GitHub container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-config-inline: |
[registry."docker.io"]
mirrors = ["dockerhub-proxy.teonite.net"]

- name: Build container
uses: docker/build-push-action@v5
with:
Expand All @@ -61,8 +70,18 @@ jobs:

docker-manifest:
runs-on: [self-hosted, Linux]

permissions:
contents: read
packages: write
id-token: write # needed for signing the images with GitHub OIDC Token

needs: [build-docker]

steps:
- name: Install Cosign
uses: sigstore/cosign-installer@v3.9.2

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
Expand All @@ -71,12 +90,14 @@ jobs:
${{ env.GHCR_REPO }}
flavor: ${{ inputs.flavor }}
tags: ${{ inputs.tags }}

- name: Login to GitHub container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create and push manifests
run: |
tags='${{ env.GHCR_REPO }}:${{ github.sha }} ${{ steps.meta.outputs.tags }}'
Expand All @@ -86,3 +107,13 @@ jobs:
docker manifest create ${tag} ${{ env.GHCR_REPO }}:${{ github.sha }}-amd64 ${{ env.GHCR_REPO }}:${{ github.sha }}-arm64
docker manifest push ${tag}
done

- name: Sign the images with GitHub OIDC Token
run: |
images='${{ env.GHCR_REPO }}:${{ github.sha }} ${{ steps.meta.outputs.tags }}'
cosign sign --yes ${images}

- name: Verify image signatures
run: |
images='${{ env.GHCR_REPO }}:${{ github.sha }} ${{ steps.meta.outputs.tags }}'
cosign verify ${images} --certificate-oidc-issuer https://token.actions.githubusercontent.com --certificate-identity-regexp="https://github.com/DefGuard/proxy" -o text
2 changes: 2 additions & 0 deletions .github/workflows/lint-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ on:
branches:
- main
- dev
- 'release/**'
paths:
- "web/**"
pull_request:
branches:
- main
- dev
- 'release/**'
paths:
- "web/**"

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ on:
branches:
- main
- dev
- 'release/**'
paths-ignore:
- "*.md"
- "LICENSE"
pull_request:
branches:
- main
- dev
- 'release/**'
paths-ignore:
- "*.md"
- "LICENSE"
Expand Down
Loading
Loading