diff --git a/tools/github/README.md b/tools/github/README.md index 05cb91f..084dcaf 100644 --- a/tools/github/README.md +++ b/tools/github/README.md @@ -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. diff --git a/tools/github/build-and-send.yaml b/tools/github/build-and-send.yaml deleted file mode 100644 index 598199a..0000000 --- a/tools/github/build-and-send.yaml +++ /dev/null @@ -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 diff --git a/tools/github/diploma-thesis-docker.yml b/tools/github/diploma-thesis-docker.yml new file mode 100644 index 0000000..20747b8 --- /dev/null +++ b/tools/github/diploma-thesis-docker.yml @@ -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 diff --git a/tools/github/diploma-thesis.yml b/tools/github/diploma-thesis.yml new file mode 100644 index 0000000..5fe2ead --- /dev/null +++ b/tools/github/diploma-thesis.yml @@ -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 \ No newline at end of file diff --git a/tools/github/github-action-secret-creation.png b/tools/github/github-action-secret-creation.png new file mode 100644 index 0000000..35f21da Binary files /dev/null and b/tools/github/github-action-secret-creation.png differ diff --git a/tools/github/github-action-secret-overview.png b/tools/github/github-action-secret-overview.png new file mode 100644 index 0000000..842a366 Binary files /dev/null and b/tools/github/github-action-secret-overview.png differ diff --git a/tools/github/github-repo-settings.png b/tools/github/github-repo-settings.png new file mode 100644 index 0000000..b85478d Binary files /dev/null and b/tools/github/github-repo-settings.png differ