Skip to content

Commit

Permalink
updated deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
SG60 authored Jul 30, 2022
1 parent 3f942d0 commit 20b35da
Showing 1 changed file with 60 additions and 16 deletions.
76 changes: 60 additions & 16 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,82 @@
# Workflow for building and deploying a SvelteKit site to GitHub Pages
name: Build and Deploy

on:
# Runs on releases
release:
types: [published]

# 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

env:
PNPM_VERSION: 7.0.0-rc.6

jobs:
# CI job
ci:
uses: sg60/sam-svelte-components/.github/workflows/ci.yml@main
build-and-deploy-pages:
needs: ci
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.

# Build job
build-pages:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.99.0
steps:
- name: Checkout 🛎️
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Pages
id: pages
uses: actions/configure-pages@v1

- uses: pnpm/action-setup@v2.2.2
with:
version: 7.0.0-rc.6
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v3
with:
node-version: '16.x'
cache: 'pnpm'
node-version: "16.x"
cache: "pnpm"
cache-dependency-path: ./pnpm-lock.yaml

- name: Install and Build 🔧
run: |
pnpm install
pnpm run build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.4.0
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
branch: gh-pages # The branch the action should deploy to.
folder: ./build # The folder the action should deploy.
path: ./build

# Deployment job
deploy-pages:
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

build-and-push-package:
needs: ci
Expand All @@ -46,20 +91,19 @@ jobs:

- uses: pnpm/action-setup@v2.2.2
with:
version: 7.0.0-rc.6
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://npm.pkg.github.com'
cache: 'pnpm'
node-version: "16.x"
registry-url: "https://npm.pkg.github.com"
cache: "pnpm"
cache-dependency-path: ./pnpm-lock.yaml

- name: Install and Build 🔧
run: |
pnpm install
pnpm run build
pnpm run package
- run: pnpm publish ./package --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 20b35da

Please sign in to comment.