keycloak-mailcow/.gitea/workflows/release.yml

48 lines
1.8 KiB
YAML
Raw Permalink Normal View History

2024-07-07 11:36:03 +02:00
name: Keycloak mailcow Build
2023-12-22 16:31:37 +01:00
on:
push:
2024-07-07 11:36:03 +02:00
branches: [main]
pull_request:
2023-12-22 16:31:37 +01:00
jobs:
2024-07-07 11:36:03 +02:00
release:
name: Build und Bereitstellung
2023-12-22 16:31:37 +01:00
runs-on: act-runner-user
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v4
- name: Build
run: |
mvn package
- name: Remove old version
2024-07-07 11:36:03 +02:00
if: gitea.event_name == 'push'
2023-12-22 16:31:37 +01:00
run: |
rm -rf /opt/data/keycloak/providers/spring-security-crypto-*.jar
rm -rf /opt/data/keycloak/providers/keycloak-mailcow-*.jar
- name: Deploy
2024-07-07 11:36:03 +02:00
if: gitea.event_name == 'push'
2023-12-22 16:31:37 +01:00
run: |
export SPRINGSEC_VERSION=$(xmlstarlet sel -N x="http://maven.apache.org/POM/4.0.0" -t -m 'x:project/x:properties/x:version.springsec' -v . pom.xml)
2023-12-22 16:34:08 +01:00
curl -sL \
https://repo1.maven.org/maven2/org/springframework/security/spring-security-crypto/$SPRINGSEC_VERSION/spring-security-crypto-$SPRINGSEC_VERSION.jar \
--output /opt/data/keycloak/providers/spring-security-crypto-$SPRINGSEC_VERSION.jar
2023-12-22 16:31:37 +01:00
export SPI_VERSION=$(xmlstarlet sel -N x="http://maven.apache.org/POM/4.0.0" -t -m 'x:project/x:version' -v . pom.xml)
2023-12-22 16:35:34 +01:00
cp -r target/keycloak-mailcow-$SPI_VERSION.jar /opt/data/keycloak/providers/keycloak-mailcow-$SPI_VERSION.jar
2023-12-22 16:31:37 +01:00
2024-07-07 11:36:03 +02:00
- name: Restart Keycloak
if: gitea.event_name == 'push'
run: |
curl -X POST -H "X-API-KEY: ${{ secrets.PORTAINER_API_KEY }}" https://docker.cantorgymnasium.de/api/stacks/48/stop\?endpointId\=1
curl -X POST -H "X-API-KEY: ${{ secrets.PORTAINER_API_KEY }}" https://docker.cantorgymnasium.de/api/stacks/48/start\?endpointId\=1
2023-12-22 16:31:37 +01:00
- name: Notification
uses: actions/telegram-action@main
if: always()
with:
chat_id: ${{ secrets.TG_CHAT_ID }}
token: ${{ secrets.TG_TOKEN }}