This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
feat: refine mike github action #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy docs | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
deploy-main: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
concurrency: | |
group: ${{ github.workflow }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: cachix/install-nix-action@V27 | |
with: | |
extra_nix_config: | | |
accept-flake-config = true | |
experimental-features = nix-command flakes | |
- name: Configure Git user | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
- name: Deploy main | |
if: ${{ github.ref_name == 'main' }} | |
run: | | |
nix develop --command bash -c "mike deploy -p main" | |
- name: Deploy version | |
if: ${{ github.ref == 'refs/tags/*' }} | |
run: | | |
nix develop --command bash -c "mike deploy -p -u ${{ github.ref_name }} latest" |