Skip to content

Commit

Permalink
Split CI & publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Frostman committed Oct 30, 2023
1 parent b1604f8 commit 16c05bd
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 30 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ on:
push:
branches:
- master
- gh-pages
- release/*
#schedule:
#- cron: '*/15 * * * *'
pull_request:
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -62,30 +59,3 @@ jobs:
timeout-minutes: 45
with:
limit-access-to-actor: true

publish:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/gh-pages'
steps:
- uses: actions/checkout@v4

- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v2
with:
publish-dir: ./
production-deploy: true
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: ${{ github.event.pull_request.title }}
enable-commit-comment: ${{ github.event_name != 'schedule' }}
fails-without-credentials: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 5

- name: Setup tmate session for debug
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 45
with:
limit-access-to-actor: true
45 changes: 45 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish docs

on:
push:
branches:
- gh-pages
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false

concurrency:
group: publish-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v2
with:
publish-dir: ./
production-deploy: true
github-token: ${{ secrets.GITHUB_TOKEN }}
enable-commit-comment: ${{ github.event_name != 'schedule' }}
fails-without-credentials: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 5

- name: Setup tmate session for debug
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 45
with:
limit-access-to-actor: true

0 comments on commit 16c05bd

Please sign in to comment.