update github actions and doku for it

This commit is contained in:
Marko Schrempf 2025-01-08 23:35:09 +01:00
parent 3f093df850
commit 09d03710d1
7 changed files with 118 additions and 45 deletions

View File

@ -1,6 +1,45 @@
# Github tools
The workflow `build-and-send.yaml` allows the user to build the diploma thesis via a github workflow.
Adapt it to meet your needs.
## General
Note that sending the thesis, and therefore automated emails, using a school email address is not supported. It is best to use an email address that does not correspond to your school email address.
The workflow `Build and send diploma thesis` allows the user to build the diploma thesis via a github workflow and send it to a Microsoft Teams channel.
## Setup
### Microsoft Teams
// TODO
### GitHub
#### Settings
In your GitHub Repository you first need to create the secrets the action needs. For that, go to the `Settings` Tab of your Repository and there under the section `Security` go to `Secrets and variables` and there to the option of `Actions`
![Github Headbar](github-repo-settings.png)
Now click on the button `New repository secret` to create the GitHub action secrets.
![Github Headbar](github-action-secret-creation.png)
Here you enter the names of the secrets and their values corresponding to the following table. After inserting one new secret click `Add secret`.
| Name | Secret |
|-|-|
| MAIL | Your email address from which the diploma thesis should be sent from |
| MAIL_PASSWORD | The password for MAIL |
| SMTP_PORT | The SMTP port corresponding to SMTP_SERVER |
| SMTP_SERVER | The SMTP Server for your email address |
| TEAMS_MAIL | The Teams channel email from the channel the diploma thesis should be sent to |
Now it should look like this:
![Github Headbar](github-action-secret-overview.png)
#### Repo
Now create a folder ```.github/workflows``` in the root of your repository and copy and paste the file ```diploma-thesis.yml``` into it. Push it and everything is set.
### Notes
- Sending the diploma thesis, and therefore automated emails, using a school email address is not supported. It is best to use an email address that does not correspond to your school email address.

View File

@ -1,42 +0,0 @@
name: Build and Send Diplomathesis
on:
push:
branches:
- main
paths:
- Diplomarbeit/**
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y git build-essential make-guile texlive-full pandoc pandoc-citeproc tree rsync hunspell hunspell-de-at
- name: Build DA-Thesis
run: |
make pdf -C HTLLE-DA-Vorlage SOURCEDIR=../Diplomarbeit/
- name: Send File via Email
uses: dawidd6/action-send-mail@v2
with:
server_address: smtp.gmail.com
server_port: 587
username: ${{ secrets.GMAIL_MAIL }}
password: ${{ secrets.GMAIL_APP_PASSWORD }}
subject: "Diploma thesis"
body: " "
to: ${{ secrets.TEAMS_MAIL }}
from: ${{ secrets.GMAIL_MAIL }}
attachments: Diplomarbeit/diplomarbeit.pdf

View File

@ -0,0 +1,37 @@
name: Build and send diploma thesis
on:
push:
branches:
- main
paths:
- Diplomarbeit/**
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
container:
image: bytebang/htlle-da-env
options: --volume=${{ github.workspace }}:/workspace
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Copy PDF to workspace
run: |
cp /workspace/Diplomarbeit/diplomarbeit.pdf $GITHUB_WORKSPACE/diplomarbeit.pdf
- 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 }}
attachments: diplomarbeit.pdf

View File

@ -0,0 +1,39 @@
name: Build and send diploma thesis
on:
push:
branches:
- main
paths:
- Diplomarbeit/**
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install git build-essential make-guile texlive-full pandoc pandoc-citeproc tree rsync hunspell hunspell-de-at
- name: Build diploma thesis
run: |
make pdf -C HTLLE-DA-Vorlage SOURCEDIR=../Diplomarbeit/
- 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 }}
attachments: Diplomarbeit/diplomarbeit.pdf

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB