Add starter workflows for Pages builds and deployments (#1645)

* commit dummy workflow

* Update nextjs.yml

* renaming

* actually do a node build

* add jekyll build & deploy

* add permissions

* update jekyll to use composite upload action

* update next to use composite upload action

* update icon yml

* change nexjs icon

* Cleanup further the Jekyll template

* add gatsby starter workflow

* fix composite error

* fix updated actions

* Add Hugo

* Apply suggestions from code review

* Inital commit for nuxtjs starter workflow

* Cleanup all templates

* Add baseUrl through an action

* Use `base_url` output for Hugo configuration

* Create static.yml

* Create static.properties.json

* clarify path

* alternative jekyll icon with only tube

* use alternate jekyll icon

* use original xvg with proper viewBox parameters

* Add paper-spa/configure-pages to starter workflows

Replaces paper-spa/setup-pages where appropriate.

* use setup-ruby action instead of our container

* Add starter workflow for GitHub Pages's legacy Jekyll build

Named `jekyll-gh-pages` so that it connotes the familiar "hands off"
build process of the Jekyll build as performed by github pages workers,
without sounding deprecated by using the words "legacy" or "classic".

* Use the static_site_generator input so we can modify the correct config

* Update gatsby.yml

* Update wording on the 'legacy' jekyll workflow

* Fix filename: this should have a json extension

* Fix filename: this should have a .properties.json extension

* Update nextjs.properties.json

* Update static.properties.json

* Fix typo in name of Gatsby

* Remove pull_request triggers

* Update to latest versions of core Actions

* Remove '--if-present' flag from 'npm run build' commands to prevent silent failure

* Perform static HTML export for Next.js

* Add '--no-install' flag to 'npx' usage

* Update Nuxt starter workflow to run 'generate'

* Default to using npm if not using yarn

* Reword 'nuxt generate' step name

* Update pages/gatsby.yml

* Update description of Jekyll starter workflow

* Add configure-pages step to static workflow

* Add configuration step to enable Pages

* Pages: Set `PREFIX_PATHS` env var for Gatsby build

* Update Next.js starter workflow to cache builds

See https://nextjs.org/docs/advanced-features/ci-build-caching#github-actions

* Update NuxtJS starter workflow to cache builds

Basically modeled after the Gatsby starter workflow

* Call out node ssg getting started + setup

* Update nuxt documentation

* Retarget actions referencing `paper-spa` to `actions`

Also point to newly published `v1` tags rather than `main` or `v0`.

Co-authored-by: yimysty <yimysty@github.com>
Co-authored-by: Tommy Byrd <tcbyrd@github.com>
Co-authored-by: Yoann Chaudet <yoannchaudet@github.com>
Co-authored-by: Timothy <tjyung@github.com>
Co-authored-by: Smitha Borkar <12040799+smithaborkar@users.noreply.github.com>
Co-authored-by: James M. Greene <JamesMGreene@github.com>
This commit is contained in:
Jess Bees
2022-07-27 09:15:54 -04:00
committed by GitHub
parent d8a6cbd17e
commit 4a8f18e34d
19 changed files with 565 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" focusable="false">
<title>
Gatsby
</title>
<circle cx="14" cy="14" r="14" fill="#639"/>
<path fill="#fff" d="M6.2 21.8C4.1 19.7 3 16.9 3 14.2L13.9 25c-2.8-.1-5.6-1.1-7.7-3.2zm10.2 2.9L3.3 11.6C4.4 6.7 8.8 3 14 3c3.7 0 6.9 1.8 8.9 4.5l-1.5 1.3C19.7 6.5 17 5 14 5c-3.9 0-7.2 2.5-8.5 6L17 22.5c2.9-1 5.1-3.5 5.8-6.5H18v-2h7c0 5.2-3.7 9.6-8.6 10.7z"/>
</svg>

After

Width:  |  Height:  |  Size: 427 B

+9
View File
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 65 KiB

+1
View File
@@ -0,0 +1 @@
<svg width="64" height="64" viewBox="2 7.5 20 11" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="25" height="25" fill="white"/><path opacity="0.1" d="M13.138 3.407C13.1286 3.44475 13.1286 3.48425 13.138 3.522C13.138 3.522 13.26 4.336 13.119 4.699L7.344 20.041C6.932 21.17 7.484 22.424 8.591 22.854C9.697 23.284 10.925 22.73 11.366 21.61L17.141 6.269C17.253 5.972 17.901 5.389 17.901 5.389C17.9283 5.36237 17.9531 5.33324 17.975 5.302V5.292C17.975 5.283 17.985 5.283 17.985 5.273C18.135 4.881 17.169 4.135 15.838 3.608C14.507 3.082 13.298 2.977 13.148 3.378C13.148 3.378 13.138 3.388 13.138 3.408V3.407Z" fill="black"/><path d="M12.97 3.273C12.9606 3.31076 12.9606 3.35024 12.97 3.388C12.97 3.388 13.092 4.202 12.951 4.565L7.176 19.906C6.764 21.036 7.317 22.29 8.423 22.72C9.53 23.15 10.758 22.596 11.198 21.476L16.973 6.135C17.086 5.838 17.733 5.255 17.733 5.255C17.7603 5.22837 17.7851 5.19924 17.807 5.168V5.158C17.807 5.149 17.817 5.149 17.817 5.139C17.967 4.747 17.001 4.001 15.67 3.474C14.339 2.948 13.13 2.843 12.98 3.244C12.98 3.254 12.98 3.264 12.97 3.274V3.273Z" fill="url(#paint0_linear_2_14)"/><path d="M14.789 10.212L10.617 21.275C10.307 22.07 9.417 22.481 8.62 22.165C7.823 21.85 7.401 20.921 7.692 20.127L10.354 13.054C10.354 13.054 10.683 12.509 11.339 12.117C11.995 11.724 12.529 11.81 13.251 11.485C13.982 11.159 14.79 10.212 14.79 10.212H14.789Z" fill="url(#paint1_linear_2_14)"/><path d="M16.81 4.82C16.894 4.598 16.296 4.156 15.475 3.833C14.655 3.509 13.921 3.426 13.838 3.648C13.755 3.869 14.353 4.311 15.174 4.634C15.995 4.958 16.728 5.041 16.811 4.819L16.81 4.82Z" fill="#333333"/><path opacity="0.3" d="M12.93 3.387C12.93 3.387 13.051 4.198 12.912 4.561L7.175 19.859C6.765 20.985 7.315 22.235 8.413 22.665C8.6 22.741 8.795 22.789 8.991 22.798C8.623 22.512 8.355 22.112 8.226 21.658C8.097 21.204 8.114 20.722 8.274 20.278L13.899 5.286C13.899 5.286 13.126 4.551 12.93 3.386V3.387Z" fill="white"/><g opacity="0.5"><path opacity="0.5" d="M11.086 13.427C11.1083 13.4267 11.1304 13.4221 11.1509 13.4133C11.1714 13.4045 11.19 13.3918 11.2056 13.3758C11.2212 13.3598 11.2335 13.3409 11.2418 13.3202C11.2501 13.2995 11.2543 13.2773 11.254 13.255C11.2543 13.2327 11.2501 13.2105 11.2418 13.1898C11.2335 13.1691 11.2212 13.1502 11.2056 13.1342C11.19 13.1182 11.1714 13.1055 11.1509 13.0967C11.1304 13.0879 11.1083 13.0833 11.086 13.083C11.0411 13.0838 10.9983 13.1023 10.967 13.1346C10.9357 13.1668 10.9185 13.2101 10.919 13.255C10.9185 13.2999 10.9357 13.3432 10.967 13.3754C10.9983 13.4077 11.0411 13.4262 11.086 13.427V13.427ZM12.176 14.744C12.315 14.744 12.428 14.628 12.428 14.486C12.428 14.344 12.315 14.228 12.176 14.228C12.037 14.228 11.925 14.344 11.925 14.486C11.925 14.628 12.037 14.744 12.176 14.744ZM10.509 16.442C10.771 16.442 10.984 16.224 10.984 15.956C10.984 15.688 10.771 15.469 10.509 15.469C10.246 15.469 10.034 15.687 10.034 15.956C10.034 16.225 10.246 16.442 10.509 16.442ZM9.745 17.11C9.884 17.11 9.997 16.995 9.997 16.853C9.997 16.711 9.884 16.595 9.745 16.595C9.606 16.595 9.494 16.71 9.494 16.853C9.494 16.996 9.606 17.11 9.745 17.11ZM10.742 18.933C10.7869 18.9322 10.8297 18.9137 10.861 18.8814C10.8923 18.8492 10.9095 18.8059 10.909 18.761C10.9093 18.7163 10.8919 18.6732 10.8606 18.6412C10.8294 18.6092 10.7867 18.5908 10.742 18.59C10.6971 18.5905 10.6542 18.6088 10.6227 18.6408C10.5913 18.6729 10.5737 18.7161 10.574 18.761C10.5737 18.7833 10.5779 18.8055 10.5862 18.8262C10.5945 18.8469 10.6068 18.8658 10.6224 18.8818C10.638 18.8978 10.6566 18.9105 10.6771 18.9193C10.6976 18.9281 10.7197 18.9327 10.742 18.933V18.933Z" fill="white"/></g><defs><linearGradient id="paint0_linear_2_14" x1="10.142" y1="7.695" x2="15.1323" y2="8.27316" gradientUnits="userSpaceOnUse"><stop stop-color="#919191"/><stop offset="1" stop-color="white"/></linearGradient><linearGradient id="paint1_linear_2_14" x1="9.842" y1="12.869" x2="12.8695" y2="13.2913" gradientUnits="userSpaceOnUse"><stop stop-color="#990000"/><stop offset="1" stop-color="#E80000"/></linearGradient></defs></svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

+3
View File
@@ -0,0 +1,3 @@
<svg width="1000" height="1000" viewBox="0 0 1000 1000" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M467.253 0.269139C465.103 0.464613 458.26 1.14878 452.102 1.63747C310.068 14.4411 177.028 91.0671 92.7664 208.841C45.8456 274.325 15.8358 348.605 4.49658 427.284C0.488759 454.748 0 462.86 0 500.098C0 537.336 0.488759 545.448 4.49658 572.912C31.6716 760.666 165.298 918.414 346.53 976.861C378.983 987.319 413.196 994.453 452.102 998.754C467.253 1000.42 532.747 1000.42 547.898 998.754C615.054 991.326 671.945 974.71 728.055 946.073C736.657 941.675 738.319 940.502 737.146 939.525C736.364 938.939 699.707 889.777 655.718 830.352L575.758 722.353L475.562 574.085C420.43 492.572 375.073 425.915 374.682 425.915C374.291 425.818 373.9 491.693 373.705 572.13C373.412 712.97 373.314 718.639 371.554 721.962C369.013 726.751 367.058 728.706 362.952 730.856C359.824 732.42 357.087 732.713 342.327 732.713H325.415L320.919 729.878C317.986 728.021 315.836 725.578 314.37 722.744L312.317 718.345L312.512 522.382L312.805 326.321L315.836 322.509C317.4 320.457 320.723 317.818 323.069 316.547C327.077 314.592 328.641 314.397 345.552 314.397C365.494 314.397 368.817 315.179 373.998 320.848C375.464 322.411 429.717 404.12 494.624 502.541C559.531 600.963 648.289 735.352 691.887 801.324L771.065 921.248L775.073 918.609C810.557 895.543 848.094 862.703 877.81 828.495C941.056 755.877 981.818 667.326 995.503 572.912C999.511 545.448 1000 537.336 1000 500.098C1000 462.86 999.511 454.748 995.503 427.284C968.328 239.53 834.702 81.7821 653.47 23.3352C621.505 12.975 587.488 5.84016 549.365 1.53972C539.98 0.562345 475.367 -0.51276 467.253 0.269139ZM671.945 302.668C676.637 305.014 680.45 309.51 681.818 314.201C682.6 316.743 682.796 371.085 682.6 493.549L682.307 669.281L651.32 621.781L620.235 574.281V446.538C620.235 363.95 620.626 317.525 621.212 315.277C622.776 309.803 626.197 305.503 630.89 302.962C634.897 300.909 636.364 300.714 651.711 300.714C666.178 300.714 668.719 300.909 671.945 302.668Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

+4
View File
@@ -0,0 +1,4 @@
<svg width="124" height="124" viewBox="0 0 124 124" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M55.7498 27.1551C52.5277 21.615 44.4723 21.6149 41.2502 27.1551L6.13404 87.5346C2.91191 93.0748 6.93956 100 13.3838 100H40.7975C38.0438 97.5934 37.0241 93.4303 39.1079 89.8584L65.7033 44.2694L55.7498 27.1551Z" fill="#80EEC0"/>
<path d="M78.0002 40.3997C80.6668 35.8668 87.3332 35.8668 89.9998 40.3997L119.061 89.801C121.728 94.3339 118.395 100 113.062 100H54.9383C49.6052 100 46.2719 94.3339 48.9385 89.801L78.0002 40.3997Z" fill="#00DC82"/>
</svg>

After

Width:  |  Height:  |  Size: 598 B

+96
View File
@@ -0,0 +1,96 @@
# Sample workflow for building and deploying a Gatsby site to GitHub Pages
#
# To get started with Gatsby see: https://www.gatsbyjs.com/docs/quick-start/
#
name: Deploy Gatsby site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: [$default-branch]
# 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 one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
# Default to bash
defaults:
run:
shell: bash
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "::set-output name=manager::yarn"
echo "::set-output name=command::install"
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "::set-output name=manager::npm"
echo "::set-output name=command::ci"
exit 0
else
echo "Unable to determine packager manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "16"
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Setup Pages
id: pages
uses: actions/configure-pages@v1
with:
# Automatically inject pathPrefix in your Gatsby configuration file.
#
# You may remove this line if you want to manage the configuration yourself.
static_site_generator: gatsby
- name: Restore cache
uses: actions/cache@v3
with:
path: |
public
.cache
key: ${{ runner.os }}-gatsby-build-${{ hashFiles('public') }}
restore-keys: |
${{ runner.os }}-gatsby-build-
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build with Gatsby
env:
PREFIX_PATHS: 'true'
run: ${{ steps.detect-package-manager.outputs.manager }} run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./public
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
+66
View File
@@ -0,0 +1,66 @@
# Sample workflow for building and deploying a Hugo site to GitHub Pages
name: Deploy Hugo site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: [$default-branch]
# 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 one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
# Default to bash
defaults:
run:
shell: bash
jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.99.0
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Pages
id: pages
uses: actions/configure-pages@v1
- name: Build with Hugo
run: |
hugo \
--minify \
--baseURL ${{ steps.pages.outputs.base_url }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./public
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
+50
View File
@@ -0,0 +1,50 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
on:
# Runs on pushes targeting the default branch
push:
branches: [$default-branch]
# 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 one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v1
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
+53
View File
@@ -0,0 +1,53 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: [$default-branch]
# 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 one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@v1
- run: bundle exec jekyll build --baseurl ${{ steps.pages.outputs.base_path }} # defaults output to '/_site'
- name: Upload artifact
uses: actions/upload-pages-artifact@v1 # This will automatically upload an artifact from the '/_site' directory
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
+95
View File
@@ -0,0 +1,95 @@
# Sample workflow for building and deploying a Next.js site to GitHub Pages
#
# To get started with Next.js see: https://nextjs.org/docs/getting-started
#
name: Deploy Next.js site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: [$default-branch]
# 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 one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "::set-output name=manager::yarn"
echo "::set-output name=command::install"
echo "::set-output name=runner::yarn"
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "::set-output name=manager::npm"
echo "::set-output name=command::ci"
echo "::set-output name=runner::npx --no-install"
exit 0
else
echo "Unable to determine packager manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "16"
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Setup Pages
id: pages
uses: actions/configure-pages@v1
with:
# Automatically inject basePath in your Next.js configuration file and disable
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
#
# You may remove this line if you want to manage the configuration yourself.
static_site_generator: next
- name: Restore cache
uses: actions/cache@v3
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next build
- name: Static HTML export with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next export
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./out
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
+90
View File
@@ -0,0 +1,90 @@
# Sample workflow for building and deploying a Nuxt site to GitHub Pages
#
# To get started with Nuxt see: https://nuxtjs.org/docs/get-started/installation
#
name: Deploy Nuxt site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: [$default-branch]
# 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 one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "::set-output name=manager::yarn"
echo "::set-output name=command::install"
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "::set-output name=manager::npm"
echo "::set-output name=command::ci"
exit 0
else
echo "Unable to determine packager manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "16"
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Setup Pages
id: pages
uses: actions/configure-pages@v1
with:
# Automatically inject router.base in your Nuxt configuration file and set
# target to static (https://nuxtjs.org/docs/configuration-glossary/configuration-target/).
#
# You may remove this line if you want to manage the configuration yourself.
static_site_generator: nuxt
- name: Restore cache
uses: actions/cache@v3
with:
path: |
dist
.nuxt
key: ${{ runner.os }}-nuxt-build-${{ hashFiles('dist') }}
restore-keys: |
${{ runner.os }}-nuxt-build-
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Static HTML export with Nuxt
run: ${{ steps.detect-package-manager.outputs.manager }} run generate
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./dist
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
+7
View File
@@ -0,0 +1,7 @@
{
"name": "Gatsby",
"creator": "GitHub Actions",
"description": "Package a Gatsby site.",
"iconName": "gatsby",
"categories": ["Pages"]
}
+7
View File
@@ -0,0 +1,7 @@
{
"name": "Hugo",
"creator": "GitHub Actions",
"description": "Package a Hugo site.",
"iconName": "hugo",
"categories": ["Pages"]
}
@@ -0,0 +1,7 @@
{
"name": "GitHub Pages Jekyll",
"creator": "GitHub Actions",
"description": "Package a Jekyll site with GitHub Pages dependencies preinstalled.",
"iconName": "jekyll-tube",
"categories": ["Pages"]
}
+7
View File
@@ -0,0 +1,7 @@
{
"name": "Jekyll",
"creator": "GitHub Actions",
"description": "Package a Jekyll site.",
"iconName": "jekyll-tube",
"categories": ["Pages"]
}
+7
View File
@@ -0,0 +1,7 @@
{
"name": "Next.js",
"creator": "GitHub Actions",
"description": "Package a Next.js site.",
"iconName": "nextjs",
"categories": ["Pages"]
}
+7
View File
@@ -0,0 +1,7 @@
{
"name": "NuxtJS",
"creator": "GitHub Actions",
"description": "Package a NuxtJS site.",
"iconName": "nuxtjs",
"categories": ["Pages"]
}
+7
View File
@@ -0,0 +1,7 @@
{
"name": "Static HTML",
"creator": "GitHub Actions",
"description": "Deploy static files in a repository without a build.",
"iconName": "html",
"categories": ["Pages"]
}
+42
View File
@@ -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: [$default-branch]
# 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 one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
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@v3
- name: Setup Pages
uses: actions/configure-pages@v1
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@main