Browse Source

improve gh actions, issue templates (#1700)

pull/1702/head
Bernd Storath 5 months ago
committed by GitHub
parent
commit
bfe572ba5f
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      .github/ISSUE_TEMPLATE/01-bug-report.yml
  2. 3
      .github/ISSUE_TEMPLATE/02-feature-request.yml
  3. 8
      .github/workflows/codeql.yml
  4. 38
      .github/workflows/deploy-development.yml
  5. 34
      .github/workflows/deploy-nightly.yml
  6. 8
      .github/workflows/deploy-pr.yml
  7. 42
      .github/workflows/deploy.yml
  8. 62
      .github/workflows/lint.yml
  9. 4
      docs/requirements.txt

1
.github/ISSUE_TEMPLATE/01-bug-report.yml

@ -4,6 +4,7 @@ description: Create a report to help us improve
title: "[Bug]: "
labels:
- "type: bug"
type: Bug
body:
- type: markdown

3
.github/ISSUE_TEMPLATE/02-feature-request.yml

@ -2,8 +2,7 @@
name: 🛠️ Feature Request
description: Suggest an idea to help us improve
title: "[Feat]: "
labels:
- "type: feature request"
type: Feature
body:
- type: markdown

8
.github/workflows/codeql.yml

@ -1,10 +1,12 @@
name: "CodeQL"
name: CodeQL
on:
push:
branches: ["master"]
branches:
- master
pull_request:
branches: ["master"]
branches:
- master
schedule:
- cron: "15 0 * * *"

38
.github/workflows/deploy-development.yml

@ -1,11 +1,11 @@
name: Build & Publish Development
name: Development
on:
workflow_dispatch:
jobs:
deploy:
name: Build & Deploy
docker:
name: Build & Deploy Docker
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
permissions:
@ -32,7 +32,37 @@ jobs:
with:
context: .
push: true
platforms: linux/amd64,linux/arm64/v8
platforms: linux/amd64,linux/arm64
tags: ghcr.io/wg-easy/wg-easy:development
cache-from: type=gha
cache-to: type=gha,mode=min
docs:
name: Build & Deploy Docs
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
permissions:
contents: write
needs: docker
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11.9
cache: "pip"
- name: Install Dependencies
run: |
pip install -r docs/requirements.txt
- name: Setup Git User
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Build Docs Website
run: |
cd docs
git fetch origin gh-pages --depth=1 || true
mike deploy --push --update-aliases development

34
.github/workflows/deploy-nightly.yml

@ -1,4 +1,4 @@
name: Build & Publish Nightly
name: Nightly
on:
workflow_dispatch:
@ -6,13 +6,13 @@ on:
- cron: "0 0 * * *"
jobs:
deploy:
name: Build & Deploy
docker:
name: Build & Deploy Docker
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
permissions:
packages: write
contents: write
contents: read
steps:
- uses: actions/checkout@v4
with:
@ -36,25 +36,37 @@ jobs:
with:
context: .
push: true
platforms: linux/amd64,linux/arm64/v8
platforms: linux/amd64,linux/arm64
tags: ghcr.io/wg-easy/wg-easy:nightly
cache-from: type=gha
cache-to: type=gha,mode=min
docs:
name: Build & Deploy Docs
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
permissions:
contents: write
needs: docker
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11.9
cache: "pip"
- name: Install Dependencies
run: |
pip install mkdocs-material
pip install pillow cairosvg mike
- name: Setup Docs Deploy
pip install -r docs/requirements.txt
- name: Setup Git User
run: |
git config --global user.name 'Docs Deploy Bot'
git config --global user.email 'docs.deploy@users.noreply.github.com'
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Build Docs Website
run: |
cd docs
git fetch origin gh-pages --depth=1
git fetch origin gh-pages --depth=1 || true
mike deploy --push --update-aliases nightly

8
.github/workflows/deploy-pr.yml

@ -1,4 +1,4 @@
name: Build Pull Request
name: Pull Request
on:
workflow_dispatch:
@ -9,8 +9,8 @@ concurrency:
cancel-in-progress: true
jobs:
deploy:
name: Build & Deploy
docker:
name: Build Docker
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
permissions:
@ -37,7 +37,7 @@ jobs:
with:
context: .
push: false
platforms: linux/amd64,linux/arm64/v8
platforms: linux/amd64,linux/arm64
tags: ghcr.io/wg-easy/wg-easy:pr
cache-from: type=gha
cache-to: type=gha,mode=min

42
.github/workflows/deploy.yml

@ -1,4 +1,4 @@
name: Build & Publish Latest
name: Production
on:
workflow_dispatch:
@ -7,15 +7,15 @@ on:
- "v*"
jobs:
deploy:
name: Build & Deploy
docker:
name: Build & Deploy Docker
runs-on: ubuntu-latest
if: |
github.repository_owner == 'wg-easy' &&
startsWith(github.ref, 'refs/tags/v')
permissions:
packages: write
contents: write
contents: read
steps:
- uses: actions/checkout@v4
@ -48,31 +48,45 @@ jobs:
with:
context: .
push: true
platforms: linux/amd64,linux/arm64/v8
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=min
docs:
name: Build & Deploy Docs
runs-on: ubuntu-latest
if: |
github.repository_owner == 'wg-easy' &&
startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
needs: docker
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11.9
cache: "pip"
- name: Install Dependencies
run: |
pip install mkdocs-material
pip install pillow cairosvg mike
- name: Setup Docs Deploy
pip install -r docs/requirements.txt
- name: Setup Git User
run: |
git config --global user.name 'Docs Deploy Bot'
git config --global user.email 'docs.deploy@users.noreply.github.com'
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Build Docs Website
run: |
cd docs
git fetch origin gh-pages --depth=1
mike deploy --push --update-aliases ${{ github.ref_name }} latest
git fetch origin gh-pages --depth=1 || true
# latest will point to old docs if old tag is pushed
# Extract version numbers (remove 'v' prefix)
# Extract version numbers
DOCS_VERSION=${GITHUB_REF#refs/tags/} # e.g. v1.2.3 or v1.2.3-beta
MINOR_VERSION=$(echo $DOCS_VERSION | cut -d. -f1,2) # e.g. v1.2
@ -81,6 +95,6 @@ jobs:
echo "Stable release detected: $DOCS_VERSION"
mike deploy --push --update-aliases $MINOR_VERSION latest
else
echo "Prerelease detected: $DOCS_VERSION"
echo "Pre-release detected: $DOCS_VERSION"
mike deploy --push --update-aliases Pre-release
fi

62
.github/workflows/lint.yml

@ -4,7 +4,6 @@ on:
push:
branches:
- master
- production
pull_request:
jobs:
@ -12,58 +11,13 @@ jobs:
name: Lint
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "lts/*"
check-latest: true
cache: "pnpm"
- name: pnpm lint
run: |
cd src
pnpm install
pnpm lint
typecheck:
name: Typecheck
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
strategy:
fail-fast: false
max-parallel: 3
matrix:
command: ["lint", "typecheck", "format:check"]
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
check-latest: true
cache: "pnpm"
- name: pnpm typecheck
run: |
cd src
pnpm install
pnpm typecheck
formatcheck:
name: Check format
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
steps:
- name: Checkout repository
uses: actions/checkout@v4
@ -76,12 +30,12 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
node-version: "lts/*"
check-latest: true
cache: "pnpm"
- name: pnpm format:check
- name: pnpm ${{ matrix.command }}
run: |
cd src
pnpm install
pnpm format:check
pnpm ${{ matrix.command }}

4
docs/requirements.txt

@ -0,0 +1,4 @@
mkdocs-material
pillow
cairosvg
mike
Loading…
Cancel
Save