Skip to content

Commit 2e2de2a

Browse files
Merge pull request #16 from ScriptAutomate/enable-gha
Enable GitHub Actions (GHA) Baseline
2 parents 0de3539 + 401c239 commit 2e2de2a

File tree

5 files changed

+118
-8
lines changed

5 files changed

+118
-8
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Workflow for building a Sphinx site and deploying artifacts to GitHub Releases
2+
name: Build Sphinx docs
3+
4+
on:
5+
push: {}
6+
pull_request: {}
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Default to bash
18+
defaults:
19+
run:
20+
shell: bash
21+
22+
jobs:
23+
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
- name: Setup Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: '3.10'
33+
cache: pip
34+
- name: Run pre-commit
35+
run: |
36+
pip install -U pip setuptools wheel
37+
pip install -r requirements-dev.txt
38+
pre-commit install
39+
pre-commit run -a -v --color always
40+
- name: Build docs
41+
run: |
42+
nox -e 'docs-html(download_versions=True, clean=True)'
43+
- name: Upload artifact
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: salt-install-guide
47+
path: ./docs/_build/html/
48+
if-no-files-found: error
49+
retention-days: 1
50+
51+
# Release job
52+
deploy:
53+
permissions:
54+
contents: write
55+
environment:
56+
name: release
57+
url: ${{ steps.deployment.outputs.page_url }}
58+
runs-on: ubuntu-latest
59+
needs:
60+
- build
61+
if: success() && github.ref == 'refs/heads/main'
62+
steps:
63+
- name: Download artifacts
64+
uses: actions/download-artifact@v4
65+
- name: Checkout
66+
uses: actions/checkout@v4
67+
- name: Display all downloaded archives/artifacts
68+
run: |
69+
ls -lah
70+
71+
echo "
72+
Listing salt-install-guide/*..."
73+
ls -lah salt-install-guide/*
74+
75+
echo "
76+
Creating archive of built salt-install-guide..."
77+
tar cvfz salt-install-guide.tar.gz salt-install-guide
78+
79+
echo "
80+
Creating checksums.txt..."
81+
sha512sum salt-install-guide.tar.gz salt.repo salt.sources > tee checksums.txt
82+
83+
- name: Release
84+
uses: softprops/action-gh-release@v2
85+
if: startsWith(github.ref, 'refs/tags/')
86+
with:
87+
files: |
88+
checksums.txt
89+
salt.repo
90+
salt.sources
91+
salt-install-guide.tar.gz

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
minimum_pre_commit_version: 2.9.3
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.4.0
5+
rev: v5.0.0
66
hooks:
77
- id: check-merge-conflict
88
description: Check for files that contain merge conflict strings.
@@ -28,33 +28,33 @@ repos:
2828
Sort the lines in specified files (defaults to alphabetical).
2929
You must provide list of target files as input in your .pre-commit-config.yaml file.
3030
files: ^(.*requirements.*\.txt|\.brokignore)$
31-
- repo: https://github.com/timothycrosley/isort
32-
rev: "5.12.0"
31+
- repo: https://github.com/PyCQA/isort
32+
rev: "5.13.2"
3333
hooks:
3434
- id: isort
3535
description: isort is a Python utility / library to sort imports automatically.
3636
files: ^((noxfile|conf)|docs/.*)\.py$
3737
- repo: https://github.com/psf/black
38-
rev: 23.9.1
38+
rev: 24.10.0
3939
hooks:
4040
- id: black
4141
description: Forces best practice formatting of Python code files.
4242
files: ^((noxfile|conf)|docs/conf|tools/version-updater|docs/_includes/python/.*)\.py$
4343
- repo: https://github.com/myint/rstcheck
44-
rev: v6.2.0
44+
rev: v6.2.4
4545
hooks:
4646
- id: rstcheck
4747
description: Checks syntax of reStructuredText/rst and code blocks nested within it.
4848
args: [--report-level=warning]
4949
additional_dependencies: [sphinx]
5050
files: ^(index|docs/.*|docs/_includes/.*|README|CONTRIBUTING)\.rst$
5151
- repo: https://github.com/asottile/blacken-docs
52-
rev: 1.16.0
52+
rev: 1.19.1
5353
hooks:
5454
- id: blacken-docs
5555
description: Run black on python code blocks in documentation files.
5656
files: ^(index|docs/.*|docs/_includes/.*)\.rst$
57-
additional_dependencies: [black==23.9.1]
57+
additional_dependencies: [black==24.10.0]
5858

5959
# - repo: https://github.com/saltstack/mirrors-nox
6060
# rev: v2022.11.21

.rstcheck.cfg

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,22 @@ ignore_substitutions=
4747
windows-x86-exe-md5,
4848
windows-x86-exe-sha256,
4949
windows-amd64-exe-gpg,
50+
macos-amd64-lts-download,
51+
macos-arm64-lts-download,
52+
macos-amd64-sts-download,
53+
macos-arm64-sts-download,
54+
minor-lts-version-badge,
55+
minor-sts-version-badge,
56+
windows-amd64-exe-lts-download,
57+
windows-amd64-msi-lts-download,
58+
windows-x86-exe-lts-download,
59+
windows-x86-msi-lts-download,
60+
windows-amd64-exe-sts-download,
61+
windows-amd64-msi-sts-download,
62+
windows-x86-exe-sts-download,
63+
windows-x86-msi-sts-download,
64+
minor-lts-version,
65+
minor-sts-version,
66+
relenv-lts-python-version,
67+
relenv-sts-python-version,
5068
ignore_messages=(.*(aix|arista)\.rst.* \(ERROR\/3\) Error in "code-block" directive\:$)

docs/topics/access-old-packages.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ policy for older versions.
2121

2222
Packages for unsupported versions of Salt, older than Salt 3006 LTS, are
2323
**NO LONGER AVAILABLE** in the Salt package repositories. See
24-
`Salt Blog: Salt Project Package Repository (repo.saltproject.io) Migration and Guidance <https://saltproject.io/blog/salt-project-package-repo-migration-and-guidance/>`__
24+
`FAQs from Salt Project Repo Migration and Open Hour <https://saltproject.io/blog/post-migration-salt-project-faqs/>`__

tools/version-updater.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Script to download Salt versions manifest and prep docs where version specific info is required
33
"""
4+
45
from pathlib import Path
56
import json
67
import shutil

0 commit comments

Comments
 (0)