Skip to content

Commit

Permalink
deploy in github io
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexRoehm committed Jul 27, 2024
1 parent f3d4725 commit 367b453
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Deploy CCF CT Ldap Wrapper
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main

jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest

steps:
- name: Check out
uses: actions/checkout@v3

- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v4
with:
images: ghcr.io/ccfreiburg/ccf-ctldap
tags: |
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}
type=ref,event=branch
type=ref,event=pr
type=sha
type=raw,latest-dev
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHR_PACKAGE_POST }}

- name: Build image
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
build-args: |
BUILDTIME=${{ fromJSON(steps.docker_meta.outputs.json).labels['org.opencontainers.image.created'] }}
VERSION=${{ fromJSON(steps.docker_meta.outputs.json).labels['org.opencontainers.image.version'] }}
REVISION=${{ fromJSON(steps.docker_meta.outputs.json).labels['org.opencontainers.image.revision'] }}

0 comments on commit 367b453

Please sign in to comment.