From ee7731334a333801ce5f26ce5224ad0ea8a3a252 Mon Sep 17 00:00:00 2001 From: Patrick Hanford Date: Tue, 25 Jun 2024 13:02:26 -0400 Subject: [PATCH] ci: add initial workflows --- .github/workflows/copy-resume.yml | 25 --------------------- .github/workflows/generate-pdf.yml | 36 ++++++++++++++++++++++++++++++ .github/workflows/release-pdf.yml | 29 ++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 25 deletions(-) delete mode 100644 .github/workflows/copy-resume.yml create mode 100644 .github/workflows/generate-pdf.yml create mode 100644 .github/workflows/release-pdf.yml diff --git a/.github/workflows/copy-resume.yml b/.github/workflows/copy-resume.yml deleted file mode 100644 index 139c930..0000000 --- a/.github/workflows/copy-resume.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: CI - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Copy resume.md to README.md - run: | - if [[ -f "resume.md" ]]; then - cp resume.md README.md - echo "resume.md has been copied to README.md" - else - echo "resume.md does not exist" - exit 1 - fi diff --git a/.github/workflows/generate-pdf.yml b/.github/workflows/generate-pdf.yml new file mode 100644 index 0000000..79c81b0 --- /dev/null +++ b/.github/workflows/generate-pdf.yml @@ -0,0 +1,36 @@ +name: CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Pandoc + run: | + sudo apt-get update + sudo apt-get install -y pandoc texlive texlive-xetex + + - name: Convert index.md to resume.pdf + run: | + if [[ -f "index.md" ]]; then + pandoc index.md -o resume.pdf + echo "index.md has been converted to resume.pdf" + else + echo "index.md does not exist" + exit 1 + fi + + - name: Upload resume.pdf as artifact + uses: actions/upload-artifact@v3 + with: + name: resume-pdf + path: resume.pdf diff --git a/.github/workflows/release-pdf.yml b/.github/workflows/release-pdf.yml new file mode 100644 index 0000000..7f22e0b --- /dev/null +++ b/.github/workflows/release-pdf.yml @@ -0,0 +1,29 @@ +name: Create Release + +on: + release: + types: [created] + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Download Artifacts + uses: actions/download-artifact@v3 + with: + name: resume-pdf + path: . + + - name: Create GitHub Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + files: resume.pdf