Skip to content

Commit

Permalink
Publish to Netlify
Browse files Browse the repository at this point in the history
  • Loading branch information
ascheman committed Aug 13, 2024
1 parent ebf90e2 commit 84dd400
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 28 deletions.
40 changes: 37 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
workflow_dispatch:
inputs:
perform_step:
publish_gh_pages:
type: boolean
description: 'Publish GH Page'
default: false
Expand Down Expand Up @@ -72,13 +72,47 @@ jobs:
path: public
retention-days: 7

publish:
publish-to-github:
runs-on: ubuntu-latest
needs: pages
if: ${{ github.event.inputs.perform_step }}
if: ${{ github.event.inputs.publish_gh_pages }}
steps:
- name: Download GitHub Pages Artifact
uses: actions/download-artifact@v4
with:
name: github-pages
path: public

- name: Deploy Pages
uses: actions/deploy-pages@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

publish-to-netlify:
runs-on: ubuntu-latest
needs: pages
environment: netlify
if: ${{ !github.event.inputs.publish_gh_pages }}
steps:
- name: Download GitHub Pages Artifact
uses: actions/download-artifact@v4
with:
name: github-pages
path: public

- name: Cache Netlify CLI
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-netlify-cli-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-netlify-cli

- name: Deploy to Netlify
uses: South-Paw/action-netlify-cli@v2
id: netlify
with:
# be sure to escape any double quotes with a backslash
args: 'deploy --json --dir ./public --message \"draft [${{ github.sha }}]\"'
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
25 changes: 0 additions & 25 deletions netlify.toml

This file was deleted.

0 comments on commit 84dd400

Please sign in to comment.