-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.68 KB
/
ci.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
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: |
sudo apt-get install --yes texlive-latex-extra texlive-fonts-recommended lmodern pandoc make
mkdir build
make
- uses: actions/upload-artifact@v1
with:
name: resume.pdf
path: build/resume.pdf
release:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d')"
- name: Get commit
id: commit
run: |
git log --format=%h -1
echo "::set-output name=commit::$(git log --format=%h -1)"
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.date.outputs.date }}-${{ steps.commit.outputs.commit }}
release_name: ${{ steps.date.outputs.date }}-${{ steps.commit.outputs.commit }}
draft: false
prerelease: false
- uses: actions/download-artifact@v4.1.7
with:
name: resume.pdf
path: $GITHUB_WORKSPACE
- name: Upload release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_content_type: application/pdf
asset_path: $GITHUB_WORKSPACE/resume.pdf
asset_name: resume.pdf