Skip to content

Commit

Permalink
Add workflow to release vedtekter PDF on push
Browse files Browse the repository at this point in the history
  • Loading branch information
otytlandsvik authored Feb 5, 2024
1 parent 1f5ddec commit ec7c5fd
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/release_pdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build and release pdf

on:
push:
branches:
- master

permissions:
contents: write

jobs:
release_pdf:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: '0'

- name: Create initial tag
run: |
if [ -z "$(git tag -l 'v*')" ]; then
git tag v0.0.0
fi
- name: Bump version and push tag
id: bump
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DEFAULT_BUMP: 'patch'

- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.bump.outputs.new_tag }}
name: Version ${{ steps.bump.outputs.new_tag }}
draft: false
prerelease: false

- name: Compile LaTeX
uses: xu-cheng/latex-action@v3
with:
root_file: vedtekter/vedtekter.tex

- name: Upload Release Asset - Vedtekter
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./vedtekter.pdf
asset_name: vedtekter.pdf
asset_content_type: application/pdf

0 comments on commit ec7c5fd

Please sign in to comment.