-
Notifications
You must be signed in to change notification settings - Fork 5
55 lines (48 loc) · 1.6 KB
/
Copy pathrelease_html.yml
File metadata and controls
55 lines (48 loc) · 1.6 KB
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
name: Publish minified HTML as release
on:
push:
branches:
- main
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install Dependencies
run: pip install -r./requirements.txt
working-directory: "./actions"
- name: Generate HTML
run: python release.py
working-directory: "./actions"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v0.${{ github.run_id }}-${{ github.run_attempt }}
release_name: Library of Time
body: The entire Library of Time website compressed into a single .html file. This release is created automatically on every push to the repo. Please disregard the version number and simply download the latest one.
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: "./actions/dist/minified.html"
asset_name: library_of_time.html
asset_content_type: text/html
- name: Trigger Vercel Deploy
if: success()
run: |
if [ -n "${{ secrets.VERCEL_DEPLOY_HOOK }}" ]; then
curl -sf -X POST "${{ secrets.VERCEL_DEPLOY_HOOK }}"
fi