update workflow #5
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: 'Show Variables' | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
display-variables: | |
name: Show GitHub Variables | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Try to show GitHub Variables | |
run: | | |
echo "repository variable : ${{ vars.REPOSITORY_VAR }}" | |
echo "organization variable : ${{ vars.ORGANIZATION_VAR }}" | |
echo "overridden variable : ${{ vars.OVERRIDE_VAR }}" | |
echo "variable from shell environment : $env_var" | |
echo "IMAGE_TAG : $vars.ENV_CONTEXT_VAR" | |
echo "IMAGE_TAG : $IMAGE_TAG" | |
echo "QUAY_URL : $QUAY_URL" | |
update-version: | |
runs-on: ubuntu-24.04 | |
outputs: | |
okr-docker-image: ${{ vars.NEW_VALUE_URL }}:${{ steps.store-version.outputs.version}}-STAGING | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{secrets.VERSION_TOKEN}} | |
- name: Extract Maven project version | |
run: echo "version=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_OUTPUT | |
id: store-version | |
- name: Set New Snapshot Version | |
run: mvn build-helper:parse-version versions:set -DnewVersion=${{ steps.store-version.outputs.version}}-SNAPSHOT -DgenerateBackupPoms=false | |
build-run-docker-image: | |
needs: update-version | |
runs-on: ubuntu-24.04 | |
services: | |
cypress: | |
image: cypress/browsers:latest | |
options: --user 1001 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Set up node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{vars.NODE_VERSION}} | |
- name: Install Dependencies | |
run: cd ./frontend && npm ci | |
- name: Build frontend with Angular | |
run: cd ./frontend && npm run build | |
- name: Build backend with Maven | |
run: mvn -B clean package --file pom.xml -P build-for-docker | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build the docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: docker/Dockerfile | |
tags: ${{ needs.update-version.outputs.okr-docker-image}} | |
load: true | |
push: false | |
- name: print imagetags | |
run: echo ${{ needs.update-version.outputs.okr-docker-image}} | |
- name: show images | |
run: docker image ls -a | |
- name: Run docker image | |
run: | | |
docker run --network=host \ | |
-e SPRING_PROFILES_ACTIVE=integration-test \ | |
${{ needs.update-version.outputs.okr-docker-image}} & | |
- name: run keycloak docker | |
run: | | |
docker run \ | |
-e KEYCLOAK_ADMIN=admin \ | |
-e KEYCLOAK_ADMIN_PASSWORD=keycloak \ | |
-v ./docker/config/realm-export.json:/opt/keycloak/data/import/realm.json \ | |
-p 8544:8080 \ | |
quay.io/keycloak/keycloak:23.0.1 \ | |
start-dev --import-realm & | |
- name: Cypress run e2e tests | |
uses: cypress-io/github-action@v6 | |
with: | |
wait-on: 'http://pitc.okr.localhost:8080/config, http://localhost:8544' | |
wait-on-timeout: 120 | |
browser: chrome | |
headed: true | |
working-directory: frontend | |
config: baseUrl=http://pitc.okr.localhost:8080 | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: cypress-screenshots | |
path: frontend/cypress/screenshots |