Repository navigation
77 lines (68 loc) · 2.51 KB
/
Copy path_deploy-github-pages.yaml
File metadata and controls
77 lines (68 loc) · 2.51 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Copyright (c) 2023 - 2026, Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.
# This workflow deploys the documentations to GitHub Pages.
name: Deploy static content to Pages
on:
workflow_call:
inputs:
artifact-name:
type: string
required: true
description: The artifact name that contains docs content
artifact-sha256:
type: string
required: true
description: The sha of the artifact that contains docs content
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
# Download the generated docs archive, verify its hash, and deploy to GitHub pages.
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Download artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ inputs.artifact-name }}
path: dist
# Verify hashes by first computing hashes for the artifacts and then comparing them
# against the hashes for the artifact.
- name: Verify the artifact hash
env:
ARTIFACT_HASH: ${{ inputs.artifact-sha256 }}
run: |
set -euo pipefail
echo "Hash of package should be $ARTIFACT_HASH."
echo "$ARTIFACT_HASH" | base64 --decode | sha256sum --strict --check --status || exit 1
# Prepare the docs content.
- name: Prepare docs for release
env:
DIST_PATH: dist
run: |
DOCS_PATH=$(find "$DIST_PATH" -depth -type f -name 'macaron-*-docs-html.zip' | head -n 1)
if [[ -z "${DOCS_PATH}" ]];
then
echo "Unable to find Macaron docs files in ${DIST_PATH}."
exit 1
fi
unzip "$DOCS_PATH"
- name: Setup Pages
uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4.0.0
- name: Upload documentation artifact
uses: actions/upload-pages-artifact@0252fc4ba7626f0298f0cf00902a25c6afc77fa8 # v3.0.0
with:
# Upload html/ directory.
path: html
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@87c3283f01cd6fe19a0ab93a23b2f6fcba5a8e42 # v4.0.3