forked from Hg/htlle-da-vorlage
update github actions and doku for it
This commit is contained in:
parent
3f093df850
commit
09d03710d1
@ -1,6 +1,45 @@
|
|||||||
# Github tools
|
# Github tools
|
||||||
|
|
||||||
The workflow `build-and-send.yaml` allows the user to build the diploma thesis via a github workflow.
|
## General
|
||||||
Adapt it to meet your needs.
|
|
||||||
|
|
||||||
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.
|
||||||
|
@ -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
|
|
37
tools/github/diploma-thesis-docker.yml
Normal file
37
tools/github/diploma-thesis-docker.yml
Normal 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
|
39
tools/github/diploma-thesis.yml
Normal file
39
tools/github/diploma-thesis.yml
Normal 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
|
BIN
tools/github/github-action-secret-creation.png
Normal file
BIN
tools/github/github-action-secret-creation.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
BIN
tools/github/github-action-secret-overview.png
Normal file
BIN
tools/github/github-action-secret-overview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
BIN
tools/github/github-repo-settings.png
Normal file
BIN
tools/github/github-repo-settings.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 152 KiB |
Loading…
Reference in New Issue
Block a user