-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
48 lines (48 loc) · 1.5 KB
/
action.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
# A github action for building archival sites and publishing them to a branch.
name: Build & Publish Archival Site
author: "Archival Team"
branding:
icon: "archive"
color: "green"
runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
- name: Set Build Dir
id: dist
run: echo "dist=$(bin/archival manifest build-dir)" >> $GITHUB_OUTPUT
shell: bash
- name: Archival Prebuild
run: bin/archival prebuild
shell: bash
- name: Build with Archival
run: bin/archival build
shell: bash
- name: Get Build Size
id: size
run: echo "bytes=$(du -s dist | cut -f1)" >> $GITHUB_OUTPUT
shell: bash
- name: Limit Build Size
if: ${{ steps.size.outputs.bytes > 104857600 }}
run: |
echo "::error title={Artifact Too Big}::${{ steps.size.outputs.bytes }} exceeds maximum build size of 104857600 bytes"
exit 1
shell: bash
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
id: artifact
with:
name: ${{ github.sha }}
path: ${{ steps.dist.outputs.dist }}
if-no-files-found: error
retention-days: 1
overwrite: true
include-hidden-files: true
- name: Deploy
uses: fjogeleit/http-request-action@v1
with:
url: "https://api.archival.dev/sync/${{ github.repository }}/${{ steps.artifact.outputs.artifact-id }}/${{ github.ref_name }}"
method: "PUT"