Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Production / HTW | |
on: | |
workflow_dispatch: | |
push: | |
# tags: | |
# - 'v*' | |
branches: | |
- 'nginx' | |
jobs: | |
deploy: | |
if: github.ref != 'refs/heads/main' | |
runs-on: ubuntu-latest | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true # Fetch Hugo themes (true OR recursive) | |
- name: Install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 21 | |
- name: Install Node.js dependencies | |
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" | |
# - name: Create Known Hosts File | |
# run: | | |
# cp bin/hugo_deployment/known_hosts ~/.ssh/known_hosts | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v3 | |
with: | |
hugo-version: 'latest' | |
extended: true | |
- name: Write gitinfo file | |
run: bin/hugo_deployment/gitversion.sh ${{ github.ref }} ${{ github.sha }} "${{ github.workflow }}" | |
- name: Build Hugo Site | |
run: | | |
hugo mod get github.com/progwebtec/classes-module | |
hugo --destination "./public_html" --minify --environment progwebtec --baseURL "https://progwebtec.f4.htw-berlin.de/" | |
- name: run deploy script | |
run: | | |
bin/hugo_deployment/progwebtec-htw.sh |