-
Notifications
You must be signed in to change notification settings - Fork 55
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 readme-update
- Loading branch information
Showing
22 changed files
with
616 additions
and
518 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 |
---|---|---|
@@ -1,60 +1,69 @@ | ||
name: Build docker on every push except main branch | ||
name: Build and/or push docker (reusable workflow) | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
workflow_call: | ||
inputs: | ||
version: | ||
description: "release version" | ||
required: true | ||
type: string | ||
tag: | ||
description: "desired tag, e.g. latest, dev (defaults to dev)" | ||
required: false | ||
type: string | ||
default: "dev" | ||
publish: | ||
description: "Specifies whether to publish the images (defaults to false)" | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
|
||
jobs: | ||
build: | ||
name: "Build" | ||
runs-on: "ubuntu-latest" | ||
name: Build | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
services: | ||
- { | ||
folder: waltid-services/waltid-issuer-api, | ||
image: issuer-api | ||
} | ||
- { | ||
folder: waltid-services/waltid-verifier-api, | ||
image: verifier-api | ||
} | ||
- { | ||
folder: waltid-services/waltid-wallet-api, | ||
image: wallet-api | ||
} | ||
- { | ||
folder: waltid-applications/waltid-web-wallet/apps/waltid-demo-wallet, | ||
image: waltid-demo-wallet | ||
} | ||
- { | ||
folder: waltid-applications/waltid-web-wallet/apps/waltid-dev-wallet, | ||
image: waltid-dev-wallet | ||
} | ||
- { | ||
folder: waltid-applications/waltid-web-portal, | ||
image: portal | ||
} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup cache | ||
uses: actions/cache@v4 | ||
- name: Login to Docker Hub | ||
if: ${{ inputs.publish }} | ||
uses: docker/login-action@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Build and push Docker images (issuer) | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Set up Docker Buildx | ||
if: ${{ !inputs.publish }} | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Build and push Docker images (${{ matrix.services.image }}) | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: false | ||
file: waltid-services/waltid-issuer-api/Dockerfile | ||
#tags: waltid/issuer-api:latest, waltid/issuer-api:${{ env.release_version }} | ||
- name: Build and push Docker images (verifier) | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: false | ||
file: waltid-services/waltid-verifier-api/Dockerfile | ||
#tags: waltid/verifier-api:latest, waltid/verifier-api:${{ env.release_version }} | ||
- name: Build and push Docker images (wallet-api) | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: false | ||
file: waltid-services/waltid-wallet-api/Dockerfile | ||
#tags: waltid/wallet-api:latest, waltid/wallet-api:${{ env.release_version }} | ||
- name: Build and push Docker images (waltid-dev-wallet) | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: false | ||
file: waltid-applications/waltid-web-wallet/apps/waltid-dev-wallet/Dockerfile | ||
#tags: waltid/waltid-dev-wallet:latest, waltid/waltid-dev-wallet:${{ env.release_version }} | ||
- name: Build and push Docker images (waltid-demo-wallet) | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: false | ||
file: waltid-applications/waltid-web-wallet/apps/waltid-demo-wallet/Dockerfile | ||
#tags: waltid/waltid-demo-wallet:latest, waltid/waltid-demo-wallet:${{ env.release_version }} | ||
- name: Build and push Docker images (wallet-portal) | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: false | ||
file: waltid-applications/waltid-web-portal/Dockerfile | ||
#tags: waltid/portal:latest, waltid/portal:${{ env.release_version }} | ||
|
||
push: ${{ inputs.publish }} | ||
file: ${{ matrix.services.folder }}/Dockerfile | ||
tags: waltid/${{ matrix.services.image }}:${{ inputs.tag }}, waltid/${{ matrix.services.image }}:${{ inputs.version }} |
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,60 @@ | ||
name: Build gradle and/or publish (reusable workflow) | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
description: "release version" | ||
required: true | ||
type: string | ||
publish: | ||
description: "Specifies whether to publish the artifacts (defaults to false)" | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/[email protected] | ||
with: | ||
tool-cache: false | ||
docker-images: false | ||
- uses: actions/checkout@v3 | ||
- name: Set version | ||
run: | | ||
sed -i "s/1.0.0-SNAPSHOT/${{ inputs.version }}/g" build.gradle.kts | ||
- name: Setup cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Setup java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '21' | ||
- name: Gradle wrapper validation | ||
uses: gradle/wrapper-validation-action@v3 | ||
- name: Set gradle build publish arguments | ||
id: publish-arguments | ||
run: | | ||
if [ "${{ inputs.publish }}" == "true" ]; then | ||
echo "arguments=publish" >> $GITHUB_OUTPUT | ||
else | ||
echo "arguments=" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Running gradle build | ||
uses: eskatos/gradle-command-action@v3 | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | ||
with: | ||
arguments: build ${{ steps.publish-arguments.outputs.arguments }} --no-daemon |
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,39 @@ | ||
name: Create changelog with tag (reusable workflow) | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
description: "release version" | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
name: Create | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | | ||
git tag v${{ inputs.version }} | ||
git push --tags | ||
- name: Changelog | ||
uses: ardalanamini/auto-changelog@v4 | ||
id: changelog | ||
with: | ||
github-token: ${{ github.token }} | ||
default-commit-type: Other Changes | ||
release-name: v${{ inputs.version }} | ||
mention-authors: true | ||
mention-new-contributors: true | ||
include-compare-link: true | ||
use-github-autolink: true | ||
semver: true | ||
- name: Create Release | ||
uses: softprops/action-gh-release@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ inputs.version }} | ||
# body: | | ||
# ${{ steps.changelog.outputs.changelog }} | ||
prerelease: ${{ steps.changelog.outputs.prerelease }} |
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,56 @@ | ||
name: Deploy to environment (reusable workflow) | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
description: "release version" | ||
required: true | ||
type: string | ||
deployment: | ||
description: "deployment file suffix (defaults to dev)" | ||
required: false | ||
type: string | ||
default: "dev" | ||
namespace: | ||
description: "deployment namespace (defaults to dev)" | ||
required: false | ||
type: string | ||
default: "dev" | ||
portals: | ||
description: "deployment namespace for portal related services (defaults to dev)" | ||
required: false | ||
type: string | ||
default: "dev" | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
env: | ||
IMAGE_TAG: ${{ inputs.version }} | ||
PORTALS: ${{ inputs.portals }} | ||
NAMESPACE: ${{ inputs.namespace }} | ||
KEYCLOAK: ${{ secrets.DEV_KEYCLOAK_CLIENT_SECRET }} | ||
strategy: | ||
matrix: | ||
services: [ | ||
{ kube: waltid-services/waltid-issuer-api/k8s, name: issuer, namespace: $PORTALS }, | ||
{ kube: waltid-services/waltid-verifier-api/k8s, name: verifier, namespace: $PORTALS }, | ||
{ kube: waltid-services/waltid-wallet-api/k8s, name: web-wallet, namespace: $NAMESPACE, keycloak: $KEYCLOAK }, | ||
{ kube: waltid-applications/waltid-web-portal/k8s, name: portal, namespace: $PORTALS } | ||
] | ||
steps: | ||
- name: Prepare CD - ${{ matrix.services.name }} | ||
run: | | ||
sed "s/_DEFAULT_DEPLOYMENT_/$GITHUB_SHA/g" ${{ matrix.services.kube }}/deployment-${{ inputs.deployment }}.yaml > ${{ matrix.services.kube }}/deployment_mod.yaml | | ||
sed "s/__DEFAULT_IMAGE_TAG__/$IMAGE_TAG/g" > ${{ matrix.services.kube }}/deployment_mod.yaml | | ||
if [ "${{ matrix.services.keycloak }}" != "" ]; then | ||
sed "s/__DEFAULT_KEYCLOAK_CLIENT_SECRET__/${{ matrix.services.keycloak }}/g" > ${{ matrix.services.kube }}/deployment_mod.yaml | ||
fi | ||
- name: Continuous deployment - ${{ matrix.services.name }} | ||
uses: actions-hub/kubectl@master | ||
env: | ||
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} | ||
with: | ||
args: apply -n ${{ matrix.services.namespace }} -f ${{ matrix.services.kube }}/deployment_mod.yaml |
Oops, something went wrong.