Deploy manually to test environment #2
Workflow file for this run
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
name: Deploy manually to test environment | ||
on: | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
name: "Deploy to test environment" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Calculate release version | ||
run: | | ||
Check failure on line 13 in .github/workflows/test-deploy.yml GitHub Actions / Deploy manually to test environmentInvalid workflow file
|
||
BRANCH_NAME="${{ github.ref#refs/heads/ }}" | ||
echo "release_version=1.0.$(date +'%g%m%d%H%M')-$BRANCH_NAME" >> $GITHUB_ENV | ||
- name: Set version | ||
run: | | ||
sed -i "s/1.0.0-SNAPSHOT/${{ env.release_version }}/g" build.gradle.kts | ||
- run: | | ||
git tag v${{ env.release_version }} | ||
git push --tags | ||
- name: Setup java | ||
uses: actions/setup-java@v2.1.0 | ||
with: | ||
distribution: 'adopt-hotspot' | ||
java-version: '15' | ||
- name: Setup cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Gradle wrapper validation | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: Running gradle build | ||
uses: eskatos/gradle-command-action@v1.3.3 | ||
with: | ||
arguments: build --no-daemon | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Build and push Docker images (issuer) | ||
uses: docker/build-push-action@v4.0.0 | ||
with: | ||
push: true | ||
file: 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@v4.0.0 | ||
with: | ||
push: true | ||
file: 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@v4.0.0 | ||
with: | ||
push: true | ||
file: waltid-wallet-api/Dockerfile | ||
tags: waltid/wallet-api:latest, waltid/wallet-api:${{ env.release_version }} | ||
- name: Build and push Docker images (waltid-web-wallet) | ||
uses: docker/build-push-action@v4.0.0 | ||
with: | ||
push: true | ||
file: waltid-web-wallet/Dockerfile | ||
tags: waltid/waltid-web-wallet:latest, waltid/waltid-web-wallet:${{ env.release_version }} | ||
- name: Build and push Docker images (wallet-portal) | ||
uses: docker/build-push-action@v4 | ||
with: | ||
push: true | ||
file: waltid-web-portal/Dockerfile | ||
tags: waltid/portal:latest, waltid/portal:${{ env.release_version }} | ||
- name: Prepare CD - issuer | ||
run: sed "s/_DEFAULT_DEPLOYMENT_/$GITHUB_SHA/g" waltid-issuer-api/k8s/deployment-dev.yaml > waltid-issuer-api/k8s/deployment_mod.yaml | ||
- name: Continuous deployment - issuer | ||
uses: actions-hub/kubectl@master | ||
env: | ||
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} | ||
with: | ||
args: apply -n portals -f waltid-issuer-api/k8s/deployment_mod.yaml | ||
- name: Prepare CD - verifier | ||
run: sed "s/_DEFAULT_DEPLOYMENT_/$GITHUB_SHA/g" waltid-verifier-api/k8s/deployment-dev.yaml > waltid-verifier-api/k8s/deployment_mod.yaml | ||
- name: Continuous deployment - verifier | ||
uses: actions-hub/kubectl@master | ||
env: | ||
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} | ||
with: | ||
args: apply -n portals -f waltid-verifier-api/k8s/deployment_mod.yaml | ||
- name: Prepare CD - wallet.walt.id | ||
run: sed "s/_DEFAULT_DEPLOYMENT_/$GITHUB_SHA/g" waltid-wallet-api/k8s/deployment-dev.yaml > waltid-wallet-api/k8s/deployment_mod.yaml | ||
- name: Continuous deployment - wallet.walt.id | ||
uses: actions-hub/kubectl@master | ||
env: | ||
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} | ||
with: | ||
args: apply -n default -f waltid-wallet-api/k8s/deployment_mod.yaml | ||
- name: Prepare CD - portal.walt.id | ||
run: sed "s/_DEFAULT_DEPLOYMENT_/$GITHUB_SHA/g" waltid-web-portal/k8s/deployment-dev.yaml > waltid-web-portal/k8s/deployment_mod.yaml | ||
- name: Continuous deployment - portal.walt.id | ||
uses: actions-hub/kubectl@master | ||
env: | ||
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} | ||
with: | ||
args: apply -n portals -f waltid-web-portal/k8s/deployment_mod.yaml |