Merge pull request 'feat(4): Replace workflow with three' (#5) from 4-split-forgejo-workflow-into-three into master
Reviewed-on: matthew.binning/www#5
This commit is contained in:
commit
bad23f192d
4 changed files with 75 additions and 22 deletions
25
.forgejo/workflows/cd.yml
Normal file
25
.forgejo/workflows/cd.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
name: CD
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
target:
|
||||
description: "Deployment target"
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- local
|
||||
- staging
|
||||
- prod
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: site-${{ github.sha }}
|
||||
path: blog/
|
||||
- name: Deploy
|
||||
run: nix shell nixpkgs#rsync --command ./deploy.sh ${{ inputs.target }}
|
||||
19
.forgejo/workflows/ci.yml
Normal file
19
.forgejo/workflows/ci.yml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build
|
||||
run: nix shell nixpkgs#mdbook --command ./deploy.sh build
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: site-${{ github.sha }}
|
||||
path: blog/
|
||||
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
name: Build and Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
schedule:
|
||||
- cron: '0 2 * * *'
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build
|
||||
run: nix shell nixpkgs#mdbook --command ./deploy.sh build
|
||||
|
||||
- name: Deploy
|
||||
run: nix shell nixpkgs#rsync --command ./deploy.sh local
|
||||
31
.forgejo/workflows/nightly.yml
Normal file
31
.forgejo/workflows/nightly.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
name: Nightly
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 2 * * *'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build
|
||||
run: nix shell nixpkgs#mdbook --command ./deploy.sh build
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: site-${{ github.sha }}
|
||||
path: blog/
|
||||
|
||||
|
||||
deploy:
|
||||
needs: build
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: site-${{ github.sha }}
|
||||
path: blog/
|
||||
- name: Deploy
|
||||
run: nix shell nixpkgs#rsync --command ./deploy.sh local
|
||||
Loading…
Add table
Add a link
Reference in a new issue