Release Version #40
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: Release Version | |
on: | |
workflow_dispatch: | |
inputs: | |
release_version: | |
description: "The Version of the Release (e.g. 0.1.0)" | |
required: false | |
default: "" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: "17" | |
architecture: x64 | |
- name: Cache local Maven repository | |
uses: actions/[email protected] | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Cache Frontend Build Node Modules | |
uses: actions/[email protected] | |
with: | |
path: client/node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Configure Git user | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "DiPA GitHub Actions" | |
- name: Einstellen des Autorisierungstoken | |
run: | | |
npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GIT_HUB_PACKAGES_ACCESS_TOKEN_WRITE }} | |
- name: Set up Node.js | |
uses: actions/[email protected] | |
with: | |
node-version: 14.x | |
registry-url: "https://npm.pkg.github.com" | |
scope: "@dipa-projekt" | |
- name: Release with Maven | |
run: mvn -s .mvn/settings.xml -B -DreleaseVersion=${{ github.event.inputs.release_version }} gitflow:release --file pom.xml | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
GIT_HUB_USERNAME: ${{ secrets.GIT_HUB_USERNAME }} | |
GIT_HUB_PACKAGES_ACCESS_TOKEN: ${{ secrets.GIT_HUB_PACKAGES_ACCESS_TOKEN_WRITE }} | |
NODE_AUTH_TOKEN: ${{ secrets.GIT_HUB_PACKAGES_ACCESS_TOKEN_WRITE }} | |
- name: Deployment to Kubernetes | |
run: | | |
git checkout -f main | |
mkdir -p ~/.ssh | |
echo -e "${{ secrets.DEPLOYMENT_SSH_KEY }}" > ~/.ssh/id_rsa | |
echo -e "${{ secrets.DEPLOYMENT_KNOWN_HOSTS }}" > ~/.ssh/known_hosts | |
chmod 600 ~/.ssh/id_rsa | |
mvn -s .mvn/settings.xml -P production-ci -B -DskipTests clean install --file pom.xml | |
scp server/target/deployment/*.yaml [email protected]:pa-deployment/main | |
ssh [email protected] kubectl apply -k pa-deployment/main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DOCKER_REGISTRY_USERNAME: dipa | |
DOCKER_REGISTRY_TOKEN: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | |
GIT_HUB_USERNAME: ${{ secrets.GIT_HUB_USERNAME }} | |
GIT_HUB_PACKAGES_ACCESS_TOKEN: ${{ secrets.GIT_HUB_PACKAGES_ACCESS_TOKEN_WRITE }} | |
NODE_AUTH_TOKEN: ${{ secrets.GIT_HUB_PACKAGES_ACCESS_TOKEN_WRITE }} |