Skip to content

Commit

Permalink
Added build P2 yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
debenol1 committed Jan 22, 2025
1 parent 8f93381 commit fa2339a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 72 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-p2-site.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build P2 Site

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
DEPLOY_SECRET: ${{ secrets.SSH_PRIVATE_KEY_ED25519_BASE64 }}
DOCKER_BUILD_IMAGE: ghcr.io/elexis/docker-build:2022-09-java17

on:
push:
workflow_dispatch:

jobs:
build:
runs-on: [self-hosted, Linux, x64, Docker]
steps:
- uses: actions/checkout@v4
- name: pull docker image ${{ env.DOCKER_BUILD_IMAGE }}
run: docker pull ${{ env.DOCKER_BUILD_IMAGE }}
- name: build using docker image ${{ env.DOCKER_BUILD_IMAGE }}
run: docker run --rm --init -v "$(pwd)":/usr/src/mymaven -v "$(eval echo ~$USER)/m2-${{ env.BRANCH_NAME }}":/root/.m2 -w /usr/src/mymaven ${{ env.DOCKER_BUILD_IMAGE }} xvfb-run mvn -V -T 1C clean verify -B -Dgit.core.branch=${{ env.BRANCH_NAME }}
- name: upload artifacts
run: |
eval $(ssh-agent -s)
ssh-add <(echo "${{ env.DEPLOY_SECRET }}" | base64 -d)
rsync -aiv --delete --mkpath -e ssh ch.elexis.base.p2site/target/repository/ deploy@download.medelexis.ch:download.elexis.info/elexis/${{ env.BRANCH_NAME }}/p2/elexis-3-base/
eval $(ssh-agent -k)
- name: Trigger elexis-3-server Workflow
run: |
curl -X POST \
--fail \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.TRIGGER_WORKFLOW_TOKEN }}" \
https://api.github.com/repos/elexis/elexis-server/actions/workflows/build-p2-site.yaml/dispatches \
-d '{"ref":"${{ env.BRANCH_NAME }}"}'
- name: Trigger gitlab medelexis-3-application Workflow
run: |
curl -X POST \
--fail \
-F token=${{ secrets.GITLAB_MEDELEXIS_3_APPLICATION_PIPELINE_TRIGGER_TOKEN }} \
-F ref=${{ env.BRANCH_NAME }} \
https://gitlab.medelexis.ch/api/v4/projects/13/trigger/pipeline
55 changes: 0 additions & 55 deletions .github/workflows/maven.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/pre-commit.yaml

This file was deleted.

0 comments on commit fa2339a

Please sign in to comment.