Skip to content

Commit

Permalink
feat: adds github actions for auto deployment of cv
Browse files Browse the repository at this point in the history
creates github pages
  • Loading branch information
FeryET committed Sep 24, 2023
1 parent 3b3f2a9 commit c9d0702
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 5 deletions.
54 changes: 49 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,66 @@
name: "Publish CV"

on:
workflow_dispatch:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- "v[0-9]+.[0-9]+.[0-9]+"

env:
ARTIFACTS_DIR: ./github-artifacts
TEX_FILE: farhood-etaati-cv.tex
PDF_FILE: farhood-etaati-cv.pdf
jobs:
build_latex:
build-latex:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v3
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v3
with:
root_file: farhood-etaati-cv.tex
root_file: $TEX_FILE
- name: move
run: mkdir -p github_artifacts && mv ${{ env.PDF_FILE }} ${{ env.ARTIFACTS_DIR }}
- name: Upload PDF file
uses: actions/upload-artifact@v3
with:
name: PDF
path: farhood-etaati-cv.pdf
name: ${{ env.PDF_FILE }}
path: ${{ env.ARTIFACTS_DIR }}

deploy:
runs-on: ubuntu-latest
needs: [build-latex]
env:
GITHUB_PAGES_DIR: ./github_pages
steps:
- name: Checkout
uses: actions/checkout@master
- name: Download artifact
uses: actions/download-artifact@v3
with:
path: ${{ env.ARTIFACTS_DIR }}
- name: Move to pages directory
run: mv ${{ env.ARTIFACTS_DIR }} ${{ env.GITHUB_PAGES_DIR }}
- name: deploy on orphan branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.GITHUB_PAGES_DIR }}
publish_branch: build
force_orphan: true
enable_jekyll: true

copy-index-to-build:
needs: [deploy]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Copy To Branches Action
uses: planetoftheweb/[email protected]
env:
key: main
files: index.html CNAME

28 changes: 28 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />

<!--You can add your name and affiliation below to personalise -->
<meta property="og:title" content="CV" />
<meta property="og:name" content="Farhood Etaati" />
<meta property="og:location" content="Tehran/Iran" />

<!--You can add your keywords to personalise-->
<meta
property="og:description"
content="MLOps, Machine Learning, Software Engineering, Backend Engineer"
/>

<meta
property="og:image"
content="https://dummyimage.com/100x100/000/fff&text=CV"
/>
<title>CV</title>
</head>
<body>
<script type="text/javascript">
window.location.href = "./farhood-etaati-cv.pdf";
</script>
</body>
</html>

0 comments on commit c9d0702

Please sign in to comment.