Skip to content

Commit c2c0584

Browse files
committed
initial commit for public
0 parents  commit c2c0584

File tree

10 files changed

+676
-0
lines changed

10 files changed

+676
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ""
5+
labels: ""
6+
assignees: ""
7+
---
8+
9+
### Describe the bug
10+
11+
A clear and concise description of what the bug is.
12+
13+
### To reproduce
14+
15+
Steps to reproduce the behavior:
16+
17+
1. Deploy this project using ...
18+
2. View output/logs/configuration on ...
19+
3. See error
20+
21+
### Expected behavior
22+
23+
A clear and concise description of what you expected to happen.
24+
25+
### Your environment
26+
27+
- Version/release of this project or specific commit
28+
<!-- - Version/release of any relevant project languages -->
29+
- Target deployment platform
30+
31+
### Additional context
32+
33+
Add any other context about the problem here.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ""
5+
labels: ""
6+
assignees: ""
7+
---
8+
9+
### Is your feature request related to a problem? Please describe
10+
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when ...
12+
13+
### Describe the solution you'd like
14+
15+
A clear and concise description of what you want to happen.
16+
17+
### Describe alternatives you've considered
18+
19+
A clear and concise description of any alternative solutions or features you've considered.
20+
21+
### Additional context
22+
23+
Add any other context or screenshots about the feature request here.

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: daily
7+
groups:
8+
actions:
9+
update-types:
10+
- "major"
11+
- "minor"
12+
- "patch"

.github/pull_request_template.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
### Proposed changes
2+
3+
Describe the use case and detail of the change. If this PR addresses an issue on GitHub, make sure to include a link to that issue using one of the [supported keywords](https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue) here in this description (not in the title of the PR).
4+
5+
### Checklist
6+
7+
Before creating a PR, run through this checklist and mark each as complete.
8+
9+
- [ ] I have read the [`CONTRIBUTING`](https://github.com/{{REPOSITORY_OWNER}}/{{REPOSITORY_URL}}/blob/main/CONTRIBUTING.md) document
10+
- [ ] If applicable, I have added tests that prove my fix is effective or that my feature works
11+
- [ ] If applicable, I have checked that any relevant tests pass after adding my changes
12+
- [ ] I have updated any relevant documentation ([`README.md`](https://github.com/{{REPOSITORY_OWNER}}/{{REPOSITORY_URL}}/blob/main/README.md) and [`CHANGELOG.md`](https://github.com/{{REPOSITORY_OWNER}}/{{REPOSITORY_URL}}/blob/main/CHANGELOG.md))

.github/workflows/docs-build-push.yml

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
name: Docs Build Push
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
AZURE_CREDENTIALS:
7+
required: true
8+
AZURE_KEY_VAULT:
9+
required: true
10+
inputs:
11+
production_url_path:
12+
description: "This will be appended to the baseURL for for production builds. For example, main docs will be `/` where agent would be `/nginx-agent`"
13+
required: true
14+
type: string
15+
preview_url_path:
16+
description: "Appended to the baseURL for PR preview builds"
17+
required: true
18+
type: string
19+
docs_source_path:
20+
description: "Directory of built docs files. Hugo default would be `./public/`"
21+
required: true
22+
type: string
23+
cdn_content_path:
24+
description: "The content path to be purged. Change to main docs repo currently requires a full '/*' purge, unless we add logic to determine specifically which docs were updated"
25+
required: true
26+
type: string
27+
doc_type:
28+
type: string
29+
description: "Type of source docs. Currently supports 'hugo' and 'sphinx'"
30+
default: hugo
31+
32+
env:
33+
GO_VERISON: "1.21" # Go version used for `hugo mod get`
34+
HUGO_VERSION: "0.115.3" # Hugo version used for building docs
35+
THEME_MODULE: "github.com/nginxinc/nginx-hugo-theme" # Name of source repo for module. For example; github.com/nginxinc/nginx-hugo-theme
36+
THEME_VERSION: "0.41.8" # Version of theme module. For example; 0.41.6
37+
38+
PR_NUMBER: ${{github.event.pull_request.number}}
39+
40+
jobs:
41+
build:
42+
runs-on: ubuntu-latest
43+
env:
44+
# Remapping of inputs to envs
45+
PRODUCTION_URL_PATH: ${{inputs.production_url_path}}
46+
PREVIEW_URL_PATH: ${{inputs.preview_url_path}}
47+
DOCS_SOURCE_PATH: ${{inputs.docs_source_path}}
48+
CDN_CONTENT_PATH: ${{inputs.cdn_content_path}}
49+
EVENT_ACTION: ${{github.event.action}}
50+
PR_MERGED: ${{github.event_name == 'push' && github.ref == 'refs/heads/main'}}
51+
concurrency:
52+
group: ${{ github.workflow }}-${{ github.ref }}
53+
steps:
54+
- name: Azure login
55+
uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1
56+
with:
57+
creds: ${{ secrets.AZURE_CREDENTIALS }}
58+
59+
- name: Retrieve secrets from Keyvault
60+
id: keyvault
61+
uses: azure/cli@965c8d7571d2231a54e321ddd07f7b10317f34d9 # v2.0.0
62+
with:
63+
inlineScript: |
64+
secrets_get=(productionHostname previewHostname resourceGroupName cdnProfileName cdnName accountName)
65+
for secret_get in ${secrets_get[@]}
66+
do
67+
value=$(az keyvault secret show --name $secret_get --vault-name ${{ secrets.AZURE_KEY_VAULT }} --query value --output tsv)
68+
echo "::add-mask::$value"
69+
echo "$secret_get=$value" >> $GITHUB_OUTPUT
70+
done
71+
72+
- name: PR preview comment
73+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
74+
if: github.event.action == 'opened'
75+
with:
76+
script: |
77+
const previewHostname = "${{steps.keyvault.outputs.previewHostname}}";
78+
const previewUrlPath = process.env.PREVIEW_URL_PATH;
79+
const prNumber = context.payload.pull_request.number;
80+
const previewUrl = `https://${previewHostname}${previewUrlPath}${prNumber}/`;
81+
82+
const body = `### <span aria-hidden="true">✅</span> Deploy Preview will be available once build job completes!
83+
84+
| Name | Link |
85+
|:-:|------------------------|
86+
|<span aria-hidden="true">😎</span> Deploy Preview | [${previewUrl}](${previewUrl}) |
87+
---`;
88+
89+
await github.rest.issues.createComment({
90+
issue_number: context.issue.number,
91+
owner: context.repo.owner,
92+
repo: context.repo.repo,
93+
body: body,
94+
});
95+
96+
- name: Checkout docs content
97+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.7.1
98+
99+
- name: Setup Go
100+
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
101+
with:
102+
go-version: ${{env.GO_VERISON}}
103+
# should only run for hugo
104+
105+
# hugo builds
106+
- name: Setup Hugo
107+
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
108+
if: inputs.doc_type == 'hugo'
109+
with:
110+
hugo-version: ${{env.HUGO_VERSION}}
111+
112+
- name: Build Hugo for PR preview
113+
if: inputs.doc_type == 'hugo' && (github.event.action == 'synchronize' || github.event.action == 'opened')
114+
run: |
115+
hugo mod get -v "$THEME_MODULE@v$THEME_VERSION"
116+
hugo --gc -e production --baseURL="https://${{steps.keyvault.outputs.previewHostname}}$PREVIEW_URL_PATH$PR_NUMBER"
117+
118+
- name: Build Hugo for production
119+
if: inputs.doc_type == 'hugo' && env.PR_MERGED == 'true'
120+
run: |
121+
hugo mod get "$THEME_MODULE@v$THEME_VERSION"
122+
hugo --gc -e production --baseURL="https://${{steps.keyvault.outputs.productionHostname}}$PRODUCTION_URL_PATH"
123+
124+
# sphinx builds
125+
126+
- name: Setup Sphinx
127+
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
128+
if: inputs.doc_type == 'sphinx'
129+
with:
130+
python-version: '3.9'
131+
132+
- name: Install python dependencies
133+
if: inputs.doc_type == 'sphinx'
134+
run: pip install -r requirements.txt
135+
136+
- name: Setup Gnupg directories
137+
if: inputs.doc_type == 'sphinx'
138+
run: |
139+
mkdir -p /home/runner/.gnupg
140+
chmod 700 /home/runner/.gnupg
141+
142+
- name: Build Sphinx for PR preview and production
143+
if: inputs.doc_type == 'sphinx'
144+
run: |
145+
make deploy
146+
147+
- name: Azure upload PR preview
148+
uses: azure/cli@965c8d7571d2231a54e321ddd07f7b10317f34d9 # v2.0.0
149+
if: github.event.action == 'synchronize' || github.event.action == 'opened'
150+
with:
151+
inlineScript: |
152+
az storage blob upload-batch -s $DOCS_SOURCE_PATH -d '$web' --destination-path "dev/${{github.repository}}/previews/${PR_NUMBER}" --account-name ${{steps.keyvault.outputs.accountName}} --overwrite --auth-mode login
153+
154+
- name: Azure upload for production
155+
uses: azure/cli@965c8d7571d2231a54e321ddd07f7b10317f34d9 # v2.0.0
156+
if: env.PR_MERGED == 'true'
157+
with:
158+
inlineScript: |
159+
az storage blob upload-batch -s $DOCS_SOURCE_PATH -d '$web' --destination-path "prod/${{github.repository}}/latest/" --account-name ${{steps.keyvault.outputs.accountName}} --overwrite --auth-mode login
160+
161+
- name: Azure purge CDN endpoint
162+
uses: azure/cli@965c8d7571d2231a54e321ddd07f7b10317f34d9 # v2.0.0
163+
with:
164+
inlineScript: |
165+
az cdn endpoint purge --content-paths $CDN_CONTENT_PATH --profile-name ${{steps.keyvault.outputs.cdnProfileName}} --name ${{steps.keyvault.outputs.cdnName}} --resource-group ${{steps.keyvault.outputs.resourceGroupName}}
166+
167+
- name: Azure logout
168+
run: |
169+
az logout
170+
if: always()

CODE_OF_CONDUCT.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
Examples of behavior that contributes to a positive environment for our community include:
12+
13+
- Demonstrating empathy and kindness toward other people
14+
- Being respectful of differing opinions, viewpoints, and experiences
15+
- Giving and gracefully accepting constructive feedback
16+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17+
- Focusing on what is best not just for us as individuals, but for the overall community
18+
19+
Examples of unacceptable behavior include:
20+
21+
- The use of sexualized language or imagery, and sexual attention or advances of
22+
any kind
23+
- Trolling, insulting or derogatory comments, and personal or political attacks
24+
- Public or private harassment
25+
- Publishing others' private information, such as a physical or email address, without their explicit permission
26+
- Other conduct which could reasonably be considered inappropriate in a professional setting
27+
28+
## Enforcement Responsibilities
29+
30+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
31+
32+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
33+
34+
## Scope
35+
36+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
37+
38+
## Enforcement
39+
40+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at <nginx-oss-community@f5.com>. All complaints will be reviewed and investigated promptly and fairly.
41+
42+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
43+
44+
## Enforcement Guidelines
45+
46+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
47+
48+
### 1. Correction
49+
50+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
51+
52+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
53+
54+
### 2. Warning
55+
56+
**Community Impact**: A violation through a single incident or series of actions.
57+
58+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
59+
60+
### 3. Temporary Ban
61+
62+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
63+
64+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
65+
66+
### 4. Permanent Ban
67+
68+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
69+
70+
**Consequence**: A permanent ban from any sort of public interaction within the community.
71+
72+
## Attribution
73+
74+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1, available at <https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>.
75+
76+
Community Impact Guidelines were inspired by
77+
[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/inclusion).
78+
79+
For answers to common questions about this code of conduct, see the FAQ at <https://www.contributor-covenant.org/faq>. Translations are available at <https://www.contributor-covenant.org/translations>.

CONTRIBUTING.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Contributing Guidelines
2+
3+
The following is a set of guidelines for contributing to this project. We really appreciate that you are considering contributing!
4+
5+
#### Table Of Contents
6+
7+
[Getting Started](#getting-started)
8+
9+
[Contributing](#contributing)
10+
11+
[Code Guidelines](#code-guidelines)
12+
13+
[Code of Conduct](https://github.com/nginxinc/docs-actions/blob/main/CODE_OF_CONDUCT.md)
14+
15+
## Getting Started
16+
17+
Follow our [Getting Started Guide](https://github.com/nginxinc/docs-actions/blob/main/README.md#Getting-Started) to get this project up and running.
18+
19+
20+
## Contributing
21+
22+
### Report a Bug
23+
24+
To report a bug, open an issue on GitHub with the label `bug` using the available bug report issue template. Please ensure the bug has not already been reported. **If the bug is a potential security vulnerability, please report it using our [security policy](https://github.com/nginxinc/docs-actions/blob/main/SECURITY.md).**
25+
26+
### Suggest a Feature or Enhancement
27+
28+
To suggest a feature or enhancement, please create an issue on GitHub with the label `enhancement` using the available [feature request template](https://github.com/nginxinc/docs-actions/blob/main/.github/feature_request_template.md). Please ensure the feature or enhancement has not already been suggested.
29+
30+
### Open a Pull Request
31+
32+
- Fork the repo, create a branch, implement your changes, add any relevant tests, submit a PR when your changes are **tested** and ready for review.
33+
- Fill in [our pull request template](https://github.com/nginxinc/docs-actions/blob/main/.github/pull_request_template.md).
34+
35+
Note: if you'd like to implement a new feature, please consider creating a [feature request issue](https://github.com/nginxinc/docs-actions/blob/main/.github/feature_request_template.md) first to start a discussion about the feature.
36+
37+
38+
### Git Guidelines
39+
40+
- Keep a clean, concise and meaningful git commit history on your branch (within reason), rebasing locally and squashing before submitting a PR.
41+
- If possible and/or relevant, use the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format when writing a commit message, so that changelogs can be automatically generated
42+
- Follow the guidelines of writing a good commit message as described here <https://chris.beams.io/posts/git-commit/> and summarised in the next few points:
43+
- In the subject line, use the present tense ("Add feature" not "Added feature").
44+
- In the subject line, use the imperative mood ("Move cursor to..." not "Moves cursor to...").
45+
- Limit the subject line to 72 characters or less.
46+
- Reference issues and pull requests liberally after the subject line.
47+
- Add more detailed description in the body of the git message (`git commit -a` to give you more space and time in your text editor to write a good message instead of `git commit -am`).

0 commit comments

Comments
 (0)