Updating GHES workflows
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by
|
||||
# separate terms of service, privacy policy, and support
|
||||
# documentation.
|
||||
|
||||
# This workflow lets you generate SLSA provenance file for your project.
|
||||
# The generation satisfies level 3 for the provenance requirements - see https://slsa.dev/spec/v0.1/requirements
|
||||
# The project is an initiative of the OpenSSF (openssf.org) and is developed at
|
||||
# https://github.com/slsa-framework/slsa-github-generator.
|
||||
# The provenance file can be verified using https://github.com/slsa-framework/slsa-verifier.
|
||||
# For more information about SLSA and how it improves the supply-chain, visit slsa.dev.
|
||||
|
||||
name: SLSA generic generator
|
||||
on:
|
||||
workflow_dispatch:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
digests: ${{ steps.hash.outputs.digests }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
# ========================================================
|
||||
#
|
||||
# Step 1: Build your artifacts.
|
||||
#
|
||||
# ========================================================
|
||||
- name: Build artifacts
|
||||
run: |
|
||||
# These are some amazing artifacts.
|
||||
echo "artifact1" > artifact1
|
||||
echo "artifact2" > artifact2
|
||||
|
||||
# ========================================================
|
||||
#
|
||||
# Step 2: Add a step to generate the provenance subjects
|
||||
# as shown below. Update the sha256 sum arguments
|
||||
# to include all binaries that you generate
|
||||
# provenance for.
|
||||
#
|
||||
# ========================================================
|
||||
- name: Generate subject
|
||||
id: hash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
# List the artifacts the provenance will refer to.
|
||||
files=$(ls artifact*)
|
||||
# Generate the subjects (base64 encoded).
|
||||
echo "::set-output name=digests::$(sha256sum $files | base64 -w0)"
|
||||
|
||||
provenance:
|
||||
needs: [build]
|
||||
permissions:
|
||||
actions: read # To read the workflow path.
|
||||
id-token: write # To sign the provenance.
|
||||
contents: write # To add assets to a release.
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
|
||||
with:
|
||||
base64-subjects: "${{ needs.build.outputs.digests }}"
|
||||
upload-assets: true # Optional: Upload to a new release
|
||||
+1
-1
@@ -16,7 +16,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x, 14.x, 16.x]
|
||||
node-version: [14.x, 16.x, 18.x]
|
||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||
|
||||
steps:
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x, 14.x, 16.x]
|
||||
node-version: [14.x, 16.x, 18.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x, 14.x, 16.x]
|
||||
node-version: [14.x, 16.x, 18.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "SLSA Generic generator",
|
||||
"creator": "Open Source Security Foundation (OpenSSF)",
|
||||
"description": "Generate SLSA3 provenance for your existing release workflows",
|
||||
"iconName": "generator-generic-ossf-slsa3-publish",
|
||||
"categories": ["Continuous integration", "Go", "Elixir", "Erlang", "PHP", "Haskell", "Rust", "Java", "Scala", "Gradle", "Maven", "Python", "C", "C++", "TypeScript", "JavaScript", "npm", "Ruby", "HTML", "Composer", "Makefile", "Ada"]
|
||||
}
|
||||
+1
-1
@@ -12,7 +12,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x, 14.x, 16.x]
|
||||
node-version: [14.x, 16.x, 18.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg fill="none" version="1.1" viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(-31)" clip-path="url(#a)">
|
||||
<path d="m161.53 3.0994e-5 0.385-0.43543-7.493-6.6222-3.311 3.7465c-0.989 1.1184-1.991 2.2222-3.008 3.3111h-117.1v7.7919l-6.8799 4.2403 2.6234 4.2565c1.3735 2.2285 2.7929 4.4196 4.2565 6.5724v93.421c-0.0339 1e-3 -0.0678 1e-3 -0.1018 2e-3l-4.9989 0.102 0.2035 9.998 4.8972-0.1v13.716h140v-88.684c1.44-2.0734 2.84-4.183 4.196-6.3282 2.279-3.4292 3.971-6.3613 5.103-8.4579 0.57-1.054 0.998-1.8986 1.29-2.4912 0.146-0.2964 0.258-0.5299 0.336-0.6953 0.039-0.0827 0.069-0.1484 0.091-0.1964l0.027-0.0587 9e-3 -0.0192 3e-3 -0.0071 1e-3 -0.0029 1e-3 -0.0013c0-6e-4 0-0.0011-4.557-2.0578l4.557 2.0567 2.057-4.5575-9.115-4.1132-2.054 4.5518v1e-3l-1e-3 9e-4 -1e-3 0.0017v2e-3l-8e-3 0.0174c-0.011 0.0234-0.03 0.0642-0.057 0.1216-0.054 0.115-0.141 0.2967-0.261 0.5399-0.239 0.4866-0.611 1.2188-1.116 2.155-0.155 0.2859-0.322 0.5907-0.501 0.9131v-32.69zm0 0h-13.427c-22.046 23.618-50.591 40.246-81.991 47.779-11.875-10.541-22.305-22.871-30.851-36.737l-2.6234-4.2565-1.6331 1.0065v15.069c8.7076 12.807 18.982 24.259 30.482 34.156 16.53 14.226 35.591 25.242 56.17 32.461-17.424 11.387-36.962 19.448-57.612 23.605-9.4774 1.907-19.19 2.992-29.04 3.199v10.002l0.1018-2e-3c10.484-0.213 20.823-1.365 30.911-3.396 25.403-5.113 49.217-15.796 69.786-31.09 15.01-11.161 28.292-24.779 39.201-40.48v-18.626c-0.996 1.7908-2.38 4.127-4.163 6.808l-0.033 0.0491-0.031 0.0498c-10.512 16.639-23.759 31.015-38.962 42.68-18.881-5.709-36.555-14.758-52.18-26.662 31.982-9.1292 60.827-27.25 82.969-52.304z" clip-rule="evenodd" fill="#f03100" fill-rule="evenodd"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="a">
|
||||
<path d="m31 28c0-15.464 12.536-28 28-28h84c15.464 0 28 12.536 28 28v84c0 15.464-12.536 28-28 28h-84c-15.464 0-28-12.536-28-28z" fill="#fff"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="none" height="48" width="48" xmlns="http://www.w3.org/2000/svg"><path d="M10.094 44.145L7 9.433h34L37.902 44.14 23.98 48z" fill="#e44d26"/><path d="M24 45.049l11.25-3.12 2.648-29.658H24z" fill="#f16529"/><path d="M24 25.145h-5.632l-.39-4.36H24V16.53H13.327l.102 1.142 1.046 11.731H24zM24 36.202l-.019.005-4.74-1.28-.303-3.396h-4.273l.596 6.685 8.72 2.42.019-.005z" fill="#ebebeb"/><g fill="#000"><path d="M10.163 0h2.163v2.138h1.98V0h2.162v6.473h-2.163V4.305h-1.978v2.168h-2.164V0zM19.313 2.147h-1.904V0h5.972v2.147h-1.905v4.326h-2.163V2.147zM24.329 0h2.255l1.388 2.274L29.358 0h2.256v6.473H29.46V3.265l-1.488 2.301h-.037l-1.49-2.301v3.208H24.33zM32.69 0h2.165v4.333h3.042v2.14H32.69z"/></g><path d="M23.985 25.145v4.258h5.242l-.494 5.52-4.748 1.282v4.43l8.726-2.42.064-.719 1-11.207.104-1.144h-1.147zM23.985 16.529v4.256h10.282l.085-.956.194-2.158.102-1.142z" fill="#fff"/></svg>
|
||||
|
After Width: | Height: | Size: 891 B |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 65 KiB |
@@ -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 |
@@ -1,96 +0,0 @@
|
||||
# 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@v2
|
||||
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
|
||||
+5
-2
@@ -1,5 +1,4 @@
|
||||
# Sample workflow for building and deploying a Hugo site to GitHub Pages
|
||||
#
|
||||
name: Deploy Hugo site to Pages
|
||||
|
||||
on:
|
||||
@@ -31,7 +30,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
HUGO_VERSION: 0.99.0
|
||||
HUGO_VERSION: 0.102.3
|
||||
steps:
|
||||
- name: Install Hugo CLI
|
||||
run: |
|
||||
@@ -45,6 +44,10 @@ jobs:
|
||||
id: pages
|
||||
uses: actions/configure-pages@v2
|
||||
- name: Build with Hugo
|
||||
env:
|
||||
# For maximum backward compatibility with Hugo modules
|
||||
HUGO_ENVIRONMENT: production
|
||||
HUGO_ENV: production
|
||||
run: |
|
||||
hugo \
|
||||
--minify \
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
# 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@v2
|
||||
- name: Build with Jekyll
|
||||
# Outputs to the './_site' directory by default
|
||||
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
|
||||
- name: Upload artifact
|
||||
# Automatically uploads an artifact from the './_site' directory by default
|
||||
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
|
||||
@@ -1,94 +0,0 @@
|
||||
# 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
|
||||
uses: actions/configure-pages@v2
|
||||
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
|
||||
@@ -1,89 +0,0 @@
|
||||
# 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
|
||||
uses: actions/configure-pages@v2
|
||||
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
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"name": "Gatsby",
|
||||
"creator": "GitHub Actions",
|
||||
"description": "Package a Gatsby site.",
|
||||
"iconName": "gatsby",
|
||||
"categories": ["Pages"]
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "Hugo",
|
||||
"creator": "GitHub Actions",
|
||||
"description": "Package a Hugo site.",
|
||||
"iconName": "hugo",
|
||||
"categories": ["Pages"]
|
||||
"categories": ["Pages", "Hugo"]
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "GitHub Pages Jekyll",
|
||||
"creator": "GitHub Actions",
|
||||
"description": "Package a Jekyll site with GitHub Pages dependencies preinstalled.",
|
||||
"iconName": "jekyll-tube",
|
||||
"categories": ["Pages"]
|
||||
"categories": ["Pages", "Jekyll"]
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"name": "Jekyll",
|
||||
"creator": "GitHub Actions",
|
||||
"description": "Package a Jekyll site.",
|
||||
"iconName": "jekyll-tube",
|
||||
"categories": ["Pages"]
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"name": "Next.js",
|
||||
"creator": "GitHub Actions",
|
||||
"description": "Package a Next.js site.",
|
||||
"iconName": "nextjs",
|
||||
"categories": ["Pages"]
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"name": "NuxtJS",
|
||||
"creator": "GitHub Actions",
|
||||
"description": "Package a NuxtJS site.",
|
||||
"iconName": "nuxtjs",
|
||||
"categories": ["Pages"]
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
"name": "Static HTML",
|
||||
"description": "Deploy static files in a repository without a build.",
|
||||
"iconName": "html",
|
||||
"categories": ["Pages"]
|
||||
"categories": ["Pages", "HTML", "JavaScript", "CSS"]
|
||||
}
|
||||
|
||||
+1
-1
@@ -39,4 +39,4 @@ jobs:
|
||||
path: '.'
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@main
|
||||
uses: actions/deploy-pages@v1
|
||||
|
||||
Reference in New Issue
Block a user