Skip to content

Commit a4036c1

Browse files
Add devcontainer and enable GHA
1 parent 5edf38b commit a4036c1

File tree

10 files changed

+142
-152
lines changed

10 files changed

+142
-152
lines changed

.devcontainer/Dockerfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM bitnami/python:3.13
2+
3+
RUN apt update && apt upgrade -y
4+
5+
# Add dev requirements
6+
ADD requirements.txt /tmp/
7+
RUN pip3 install -r /tmp/requirements.txt
8+
RUN rm /tmp/requirements.txt

.devcontainer/devcontainer.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
{
3+
"name": "salt-user-guide",
4+
5+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
6+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
7+
// Python container image is needed for running python-based tests (ex. orphaned-content.py)
8+
// "image": "mcr.microsoft.com/devcontainers/python:3.13-bookworm",
9+
10+
"build": {
11+
"dockerfile": "Dockerfile"
12+
},
13+
14+
// Features to add to the dev container. More info: https://containers.dev/features.
15+
// "features": {
16+
// node / npm is required for markdownlint-cli2
17+
// By default, installs lts version
18+
// "ghcr.io/devcontainers/features/node:1": {}
19+
// },
20+
21+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
22+
// "forwardPorts": [],
23+
24+
// Use 'postCreateCommand' to run commands after the container is created.
25+
// "postCreateCommand": ""
26+
27+
// There is also a postStartCommand that executes every time the container starts.
28+
// The parameters behave exactly like postCreateCommand, but the commands execute on start rather than create.
29+
// "postStartCommand": ""
30+
31+
// There is also a postAttachCommand that executes every time the container attaches to a workspace.
32+
// The parameters behave exactly like postCreateCommand, but the commands execute on a started container after the workspace is available under /workspaces/
33+
// "postAttachCommand": {},
34+
35+
// Configure tool-specific properties.
36+
"customizations": {
37+
// Configure properties specific to VS Code.
38+
"vscode": {
39+
// Add the IDs of extensions you want installed when the container is created.
40+
"extensions": [
41+
// Extension to work with Python
42+
"ms-python.python"
43+
]
44+
}
45+
}
46+
47+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
48+
// "remoteUser": "root"
49+
}
File renamed without changes.
+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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-24.04
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.13'
33+
cache: pip
34+
- name: Run pre-commit
35+
run: |
36+
pip install -U pip setuptools wheel
37+
pip install -r .devcontainer/requirements.txt
38+
pre-commit install
39+
pre-commit run -a -v --color always
40+
- name: Build docs
41+
run: |
42+
nox -e 'docs-html(gen_sitevars=True, clean=True)'
43+
- name: Upload artifact
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: salt-user-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+
runs-on: ubuntu-24.04
56+
needs:
57+
- build
58+
if: success() && startsWith(github.ref, 'refs/tags/')
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v4
62+
- name: Download artifacts
63+
uses: actions/download-artifact@v4
64+
- name: Display all downloaded archives/artifacts
65+
run: |
66+
ls -lah
67+
68+
echo "
69+
Listing salt-user-guide/*..."
70+
ls -lah salt-user-guide/*
71+
72+
echo "
73+
Creating archive of built salt-user-guide..."
74+
tar cvfz salt-user-guide.tar.gz salt-user-guide
75+
76+
echo "
77+
Creating checksums.txt..."
78+
sha512sum salt-user-guide.tar.gz salt.repo salt.sources | tee checksums.txt
79+
80+
- name: Release
81+
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda
82+
with:
83+
files: |
84+
checksums.txt
85+
salt-user-guide.tar.gz

.gitlab-ci.yml

-62
This file was deleted.

.gitlab/issue_templates/documentation-bug-report.md

-15
This file was deleted.

.gitlab/merge_request_templates/salt-user-guide-merge-request.md

-32
This file was deleted.

.rstcheck.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ ignore_directives=
1111
tab-set,
1212
ignore_substitutions=
1313
release,
14-
ignore_messages=(.*(aix|arista)\.rst.* \(ERROR\/3\) Error in "code-block" directive\:$)

.vale.ini

-13
This file was deleted.

vendir.yml

-29
This file was deleted.

0 commit comments

Comments
 (0)