-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (79 loc) · 2.35 KB
/
release.yaml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Release LaTeX document
on:
workflow_dispatch:
inputs:
release_name:
description: A name of a release
type: string
required: true
version:
description: A version to release
type: string
required: true
texfile:
description: Name of the main LaTeX file (must be in repo's root; without extension)
type: string
required: true
deploy:
description: Specifies whether to deploy to GitHub Pages or not (true/false)
type: boolean
required: true
permissions:
contents: write
packages: write
env:
DEPLOY_DIR: 'github_deploy'
DEPLOY_BRANCH: 'build'
OUTPUT_DIR: 'github_artifacts'
jobs:
build:
name: Build document
uses: ./.github/workflows/build-latex.yaml
with:
texfile: ${{ github.event.inputs.texfile }}
deploy:
if: ${{ github.event.inputs.deploy == true }}
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: List files
run: ls -R
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: ./${{ env.OUTPUT_DIR }}
- name: List files
run: ls -R
- name: Move files
run: mkdir -p ${{ env.DEPLOY_DIR }} && mv ${{ env.OUTPUT_DIR }}/*/* ${{ env.DEPLOY_DIR }}
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.DEPLOY_TOKEN }}
publish_dir: ${{ env.DEPLOY_DIR }}
publish_branch: ${{ env.DEPLOY_BRANCH}}
force_orphan: true
release:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: ./${{ env.OUTPUT_DIR }}
- name: List files
run: ls -R
- name: Create release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.DEPLOY_TOKEN }}
prerelease: false
draft: false
automatic_release_tag: ${{ github.event.inputs.version }}
title: ${{ github.event.inputs.release_name }} ${{ github.event.inputs.version }}
files: |
./${{ env.OUTPUT_DIR }}/${{ github.event.inputs.texfile }}.pdf