mirror of
https://github.com/foo-dogsquared/website.git
synced 2025-01-31 04:58:26 +00:00
Update GitHub workflow for building drafts
This commit is contained in:
parent
303a49fdcd
commit
e831be1709
30
.github/workflows/build-drafts.yml
vendored
30
.github/workflows/build-drafts.yml
vendored
@ -1,30 +0,0 @@
|
|||||||
name: "Build and deploy drafted versions to Netlify"
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- drafts/*
|
|
||||||
- content/*
|
|
||||||
workflow_run:
|
|
||||||
workflows:
|
|
||||||
- "Update webring"
|
|
||||||
types:
|
|
||||||
- "completed"
|
|
||||||
env:
|
|
||||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_ACCESS_TOKEN }}
|
|
||||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: cachix/install-nix-action@v20
|
|
||||||
with:
|
|
||||||
nix_path: nixpkgs=channel:nixpkgs-unstable
|
|
||||||
- name: Fetch all 'content/' branches
|
|
||||||
run: |
|
|
||||||
git fetch origin +refs/heads/content/*:refs/heads/content/*
|
|
||||||
- name: Build and deploy site
|
|
||||||
run: |
|
|
||||||
nix develop --command bash -c "netlify deploy --build --context branch-deploy"
|
|
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@ -3,6 +3,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- drafts/*
|
||||||
- content/*
|
- content/*
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows:
|
workflows:
|
||||||
@ -25,6 +26,11 @@ jobs:
|
|||||||
- name: Fetch all 'content/' branches
|
- name: Fetch all 'content/' branches
|
||||||
run: |
|
run: |
|
||||||
git fetch origin +refs/heads/content/*:refs/heads/content/*
|
git fetch origin +refs/heads/content/*:refs/heads/content/*
|
||||||
- name: Build and deploy site
|
- if: github.ref_name == 'master'
|
||||||
|
name: Build and deploy site
|
||||||
run: |
|
run: |
|
||||||
nix develop --command bash -c "netlify deploy --build --prod"
|
nix develop --command bash -c "netlify deploy --build --prod"
|
||||||
|
- if: starts_with('drafts/', github.ref_name)
|
||||||
|
name: Build and deploy draft versions of the site
|
||||||
|
run: |
|
||||||
|
nix develop --command bash -c "netlify deploy --build --context branch-deploy"
|
||||||
|
Loading…
Reference in New Issue
Block a user