-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (65 loc) · 1.88 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: "Publish CV"
on:
workflow_dispatch:
push:
tags:
- "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:
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: ${{ env.TEX_FILE }}
- name: move
run: mkdir -p ${{ env.ARTIFACTS_DIR}} && mv ${{ env.PDF_FILE }} ${{ env.ARTIFACTS_DIR }}
- name: Upload PDF file
uses: actions/upload-artifact@v3
with:
name: ${{ env.PDF_FILE }}
path: ${{ env.ARTIFACTS_DIR }}/${{ env.PDF_FILE }}
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/[email protected]
with:
name: ${{ env.PDF_FILE }}
path: ${{ env.ARTIFACTS_DIR }}/
- name: Move to pages directory
run: mv ${{ env.ARTIFACTS_DIR }} ${{ env.GITHUB_PAGES_DIR }}
- name: Display structure of branch pre-publish
run: ls -R
working-directory: ./
- 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: master
files: index.html CNAME