-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc(core): gh action to publish gh page from demo/vanilla-js
- Loading branch information
Showing
4 changed files
with
90 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "Upload GitHub Pages artifact" | ||
description: "A composite action that prepares your static assets to be deployed to GitHub Pages" | ||
author: "GitHub" | ||
inputs: | ||
name: | ||
description: 'Artifact name' | ||
required: false | ||
default: 'github-pages' | ||
path: | ||
description: "Path of the directory containing the static assets." | ||
required: true | ||
default: "_site/" | ||
retention-days: | ||
description: "Duration after which artifact will expire in days." | ||
required: false | ||
default: "1" | ||
outputs: | ||
artifact_id: | ||
description: "The ID of the artifact that was uploaded." | ||
value: ${{ steps.upload-artifact.outputs.artifact-id }} | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Archive artifact | ||
shell: sh | ||
if: runner.os == 'Linux' | ||
run: | | ||
echo ::group::Archive artifact | ||
tar \ | ||
--dereference --hard-dereference \ | ||
--directory "$INPUT_PATH" \ | ||
-cvf "$RUNNER_TEMP/artifact.tar" \ | ||
--exclude=.git \ | ||
--exclude=.github \ | ||
"$INPUT_PATH" | ||
echo ::endgroup:: | ||
env: | ||
INPUT_PATH: ${{ inputs.path }} | ||
- name: Upload artifact | ||
id: upload-artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.name }} | ||
path: ${{ runner.temp }}/artifact.tar | ||
retention-days: ${{ inputs.retention-days }} | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Simple workflow for deploying static content to GitHub Pages | ||
name: Deploy static content to Pages | ||
|
||
on: | ||
# Runs on pushes targeting the default branch | ||
push: | ||
branches: ["master"] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
# Single deploy job since we're just deploying | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Upload artifacts | ||
uses: ./.github/actions/upload-pages-artifact | ||
with: | ||
path: 'demo/vanilla-js public' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters