Skip to content

Add code copy feature #25

Add code copy feature

Add code copy feature #25

Workflow file for this run

# Simple workflow for deploying static content to GitHub Pages
name: Release
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Single deploy job since we're just deploying
BuildAndDeploy:
name: Build and Deploy
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Install python
uses: actions/setup-python@v2
- name: Install mkdocs plus extensions
run: |
pip install mkdocs
pip install mkdocs-material
pip install mkdocs-mermaid2-plugin
pip install mkdocs-git-revision-date-localized-plugin
# pip install mkdocs-git-committers-plugin-2
# pip install mkdocs-git-authors-plugin
- name: Tag and Create Release
shell: pwsh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$today = Get-Date -Format "yyyy.MMdd"
$tag = "$today.$($env:GITHUB_RUN_NUMBER)"
git config user.name "Blog Publisher"
git config user.email "[email protected]"
Write-Host "Tagging version $tag"
git tag -a $tag -m "$tag"
git push origin $tag
gh release create $tag -t $tag -n "Release $tag" --notes "Release $tag" --target main
- name: Build site
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SITE_URL: "https://www.jabbermouth.co.uk"
run: mkdocs build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4