Skip to content

Release 0.2.1

Release 0.2.1 #7

Workflow file for this run

---
name: Release on Docker Hub and GitHub
on:
push:
tags: ['v*.*.*']
env:
IMAGE: ${{ vars.DOCKERHUB_USERNAME }}/${{ vars.DOCKERHUB_REPOSITORY }}
OUTPUT_DIR: public
ARTIFACTS_NAME: pdf
jobs:
docker:
name: Build and push Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Render PDFs
uses: kadykov/typstCV@main
with:
output-folder: ${{ env.OUTPUT_DIR }}
- name: Upload rendered PDFs
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACTS_NAME }}
path: ${{ env.OUTPUT_DIR }}/
if-no-files-found: error
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=registry,ref=${{ env.IMAGE }}:latest
cache-to: type=inline
publish:
name: Publish to GitHub pages
needs: docker
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Download rendered PDFs
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACTS_NAME }}
path: ${{ env.OUTPUT_DIR }}/
- name: Deploy CV to GitHub pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./${{ env.OUTPUT_DIR }}
release:
name: Create a GitHub release
needs: docker
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version from tag
id: tag_name
run: echo "current_version=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
shell: bash
- name: Download rendered PDFs
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACTS_NAME }}
path: ${{ env.OUTPUT_DIR }}/
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_level: error
version: ${{ steps.tag_name.outputs.current_version }}
path: ./CHANGELOG.md
- name: Create release on GitHub
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.changelog_reader.outputs.version }}
name: Release ${{ steps.changelog_reader.outputs.version }}
body: ${{ steps.changelog_reader.outputs.changes }}
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: ${{ env.OUTPUT_DIR }}/*.pdf