-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
110 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: 'create docker image' | ||
description: 'Builds a docker image and tags it' | ||
inputs: | ||
- name: 'IMAGE_NAME' | ||
description: 'The image name' | ||
required: true | ||
- name: 'VERSION' | ||
description: 'The version of the image' | ||
required: true | ||
- name: 'TAG' | ||
description: 'The tag of the image' | ||
required: true | ||
- name: 'DOCKERFILE' | ||
description: 'The path to the Dockerfile' | ||
required: true | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set environment variables | ||
run: | | ||
echo COMMITED_AT=$(git show -s --format=%cI `git rev-parse HEAD`) >> $GITHUB_ENV | ||
echo REVISION=$(git rev-parse --short HEAD) >> $GITHUB_ENV | ||
- name: Collect docker image metadata | ||
id: meta-data | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ inputs.IMAGE_NAME }} | ||
labels: | | ||
org.opencontainers.image.created=${{ env.COMMITED_AT }} | ||
org.opencontainers.image.version=${{ inputs.VERSION }} | ||
org.opencontainers.image.maintainer=EBP Schweiz AG | ||
flavor: | | ||
latest=false | ||
tags: | | ||
type=${{ inputs.TAG }} | ||
type=semver,pattern={{version}},value=${{ inputs.VERSION }} | ||
- name: Log in to the GitHub container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./ | ||
file: ${{ inputs.DOCKERFILE }} | ||
push: true | ||
build-args: | | ||
VERSION=${{ inputs.VERSION }} | ||
REVISION=${{ env.REVISION }} | ||
tags: ${{ steps.meta-data.outputs.tags }} | ||
labels: ${{ steps.meta-data.outputs.labels }} | ||
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:${{ inputs.TAG }} | ||
cache-to: type=inline |
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,4 +1,4 @@ | ||
name: CI | ||
name: ci | ||
|
||
on: | ||
push: | ||
|
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,4 +1,4 @@ | ||
name: "CodeQL" | ||
name: code-ql | ||
|
||
on: | ||
push: | ||
|
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,41 @@ | ||
name: dev-deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BASE_IMAGE_NAME: ghcr.io/geoadmin/swissgeol-assets | ||
|
||
jobs: | ||
build-push-docker-images: | ||
runs-on: ubuntu-latest | ||
name: Build and push docker images | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Define version | ||
run: | | ||
echo VERSION=$(cat VERSION).$GITHUB_RUN_NUMBER >> $GITHUB_ENV | ||
- name: Build and push docker image (app) | ||
uses: ./.github/actions/create-image | ||
with: | ||
IMAGE_NAME: ${{ env.BASE_IMAGE_NAME }}-app | ||
VERSION: ${{ env.VERSION }} | ||
TAG: edge | ||
DOCKERFILE: ./apps/client-asset-sg/docker/Dockerfile | ||
|
||
- name: Build and push docker image (api) | ||
uses: ./.github/actions/create-image | ||
with: | ||
IMAGE_NAME: ${{ env.BASE_IMAGE_NAME }}-api | ||
VERSION: ${{ env.VERSION }} | ||
TAG: edge | ||
DOCKERFILE: ./apps/server-asset-sg/docker/Dockerfile |
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,4 +1,4 @@ | ||
name: Release | ||
name: release | ||
|
||
on: | ||
release: | ||
|