2025-01-08 23:35:09 +01:00
|
|
|
name: Build and send diploma thesis
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
|
|
|
- Diplomarbeit/**
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
2025-01-09 22:28:48 +01:00
|
|
|
build-send::
|
2025-01-08 23:35:09 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
2025-01-09 11:30:35 +01:00
|
|
|
- name: Cache Docker image
|
|
|
|
id: cache-docker
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: /tmp/.docker
|
|
|
|
key: ${{ runner.os }}-docker-${{ hashFiles('**/HTLLE-DA-Vorlage/tools/docker/Dockerfile') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-docker-
|
|
|
|
|
|
|
|
- name: Create Docker cache directory
|
|
|
|
if: steps.cache-docker.outputs.cache-hit != 'true'
|
|
|
|
run: mkdir -p /tmp/.docker
|
|
|
|
|
|
|
|
- name: Load cached Docker image
|
|
|
|
if: steps.cache-docker.outputs.cache-hit == 'true'
|
|
|
|
run: docker load -i /tmp/.docker/image.tar
|
|
|
|
|
|
|
|
- name: Pull Docker image
|
|
|
|
if: steps.cache-docker.outputs.cache-hit != 'true'
|
2025-01-08 23:35:09 +01:00
|
|
|
run: |
|
2025-01-09 11:30:35 +01:00
|
|
|
docker pull bytebang/htlle-da-env
|
|
|
|
docker save bytebang/htlle-da-env -o /tmp/.docker/image.tar
|
|
|
|
|
|
|
|
- name: Build diploma thesis
|
|
|
|
run: docker run -v ${{ github.workspace }}/Diplomarbeit:/workspace bytebang/htlle-da-env
|
2025-01-08 23:35:09 +01:00
|
|
|
|
|
|
|
- name: Send diploma thesis
|
|
|
|
uses: dawidd6/action-send-mail@v4
|
|
|
|
with:
|
|
|
|
server_address: ${{ secrets.SMTP_SERVER }}
|
|
|
|
server_port: ${{ secrets.SMTP_PORT }}
|
|
|
|
username: ${{ secrets.MAIL }}
|
|
|
|
password: ${{ secrets.MAIL_PASSWORD }}
|
|
|
|
subject: "Diploma thesis"
|
|
|
|
body: " "
|
|
|
|
to: ${{ secrets.TEAMS_MAIL }}
|
|
|
|
from: ${{ secrets.MAIL }}
|
2025-01-09 09:22:28 +01:00
|
|
|
attachments: Diplomarbeit/diplomarbeit.pdf
|