forked from Hg/htlle-da-vorlage
78 lines
2.5 KiB
YAML
78 lines
2.5 KiB
YAML
name: Build and send diploma thesis
|
|
description: GitHub action to build and send a diploma thesis using the corresponding docker image from school HTL Leoben
|
|
author: bitsneak
|
|
branding:
|
|
icon: mail
|
|
color: yellow
|
|
|
|
inputs:
|
|
thesis-path:
|
|
description: The path to the filled out diploma thesis folder. If not set it will default to Diplomarbeit
|
|
default: Diplomarbeit
|
|
required: false
|
|
smtp-server:
|
|
description: The smtp server of your sending email
|
|
required: true
|
|
smtp-port:
|
|
description: The smtp server port of your sending emai'
|
|
required: true
|
|
mail-address:
|
|
description: The sending email address
|
|
required: true
|
|
mail-address-password:
|
|
description: The password for the sending email address
|
|
required: true
|
|
teams-mail:
|
|
description: The email address of the teams channel the diploma thesis is sent to
|
|
required: true
|
|
|
|
runs:
|
|
using: composite
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- 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'
|
|
shell: bash
|
|
run: mkdir -p /tmp/.docker
|
|
|
|
- name: Load cached Docker image
|
|
if: steps.cache-docker.outputs.cache-hit == 'true'
|
|
shell: bash
|
|
run: docker load -i /tmp/.docker/image.tar
|
|
|
|
- name: Pull Docker image
|
|
if: steps.cache-docker.outputs.cache-hit != 'true'
|
|
shell: bash
|
|
run: |
|
|
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}
|
|
docker save ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }} -o /tmp/.docker/image.tar
|
|
|
|
- name: Build diploma thesis
|
|
shell: bash
|
|
run: docker run -v ${{ github.workspace }}/${{ inputs.thesis-path }}:/workspace ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}
|
|
|
|
- name: Send diploma thesis
|
|
uses: dawidd6/action-send-mail@v4
|
|
with:
|
|
server_address: ${{ inputs.smtp-server }}
|
|
server_port: ${{ inputs.smtp-port }}
|
|
username: ${{ inputs.mail-address }}
|
|
password: ${{ inputs.mail-address-password }}
|
|
subject: "Diploma thesis"
|
|
body: " "
|
|
to: ${{ inputs.teams-mail }}
|
|
from: ${{ inputs.mail-address }}
|
|
attachments: ${{ inputs.thesis-path }}/diplomarbeit.pdf
|