Skip to content

Commit

Permalink
feat: uploading to gh-pages via artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
1mamute committed Jul 14, 2023
1 parent ece111c commit ae4eca5
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1,024 deletions.
59 changes: 55 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,56 @@ on:
- completed
branches:
- main
# 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: write
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:
release:
build:
strategy:
matrix:
node-version: [20.x]

name: Create a new release
name: Build a new release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
#persist-credentials: false

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"


- name: Setup Pages
uses: actions/configure-pages@v3

- 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') }}-
- run: HUSKY=0 npm ci
- name: Building static files
run: npm run build-prod
Expand All @@ -37,3 +65,26 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./out

# Deployment job
deploy:
strategy:
matrix:
node-version: [20.x]

name: Build a new release
runs-on: ubuntu-latest
needs: build

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
Loading

0 comments on commit ae4eca5

Please sign in to comment.