Skip to content

Commit 0ca0bee

Browse files
chore(docs): deploy docs gh pages github workflow (#4)
* chore(docs): deploy docs in gh pages we added some steps in github workflow to deploy the documentation in github pages * chore(docs): remove mkdocs configuration of emojis this extension is no longer exists * chore(docs): add alias and version number to the docs deploy we add the git user and mail * chore(docs): fix the run command in set upd docs deploy step We added a doble quites unexpected, we remove it here * chore(docs): remove doble quotes when we adde the git user configuration there was an unexpectd doble quotes * chore(docs): add github deploy command for docs this command deploy the documentacion in Github Pages * chore(docs): deploy docs with mike command with this type of deployment, we will have all versions available in the doc * WIP: add console log of release tag we need the version number * chore(docs): add step to get the last tag we need this tag for mkdocs deployment * chore(docs): add output with latest version tags we use this output in the step to deploy de version of the docs * chore(docs): add a git command to get the lates tag we use this to create a new release of the doc * chore(docs): change the code to get the tag version we need this version to deploy docs * chore(docs): add full clone we need this version to deploy docs * feat(docs): add mkdocs deploy it add in gihub workflow the step to deploy in github pages * feat(docs): update api docs it updates the construct hub badge
1 parent 1675d5c commit 0ca0bee

File tree

6 files changed

+98
-9
lines changed

6 files changed

+98
-9
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 37 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projenrc.ts

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,45 @@ deployDocs?.on({
6161
workflows: ['release'],
6262
types: ['completed'],
6363
},
64+
workflowCall: {
65+
inputs: {
66+
version: {
67+
required: true,
68+
type: 'string',
69+
description: 'Version to build and publish docs',
70+
},
71+
alias: {
72+
required: true,
73+
type: 'string',
74+
description: 'Alias to associate version (latest, stage)',
75+
},
76+
},
77+
},
6478
});
6579

6680
deployDocs?.addJob('deploy-docs', {
6781
permissions: {
6882
contents: JobPermission.WRITE,
83+
pages: JobPermission.WRITE,
6984
},
7085
runsOn: ['ubuntu-latest'],
86+
outputs: {
87+
getVersion: {
88+
stepId: 'getVersion',
89+
outputName: 'version',
90+
},
91+
},
7192
steps: [
7293
{
7394
uses: 'actions/checkout@v4',
95+
with: {
96+
'fetch-depth': 0,
97+
},
7498
},
7599
{
76100
uses: 'actions/setup-python@v4',
77101
with: {
78-
pythonVersion: '3.x',
102+
pythonVersion: '3.8',
79103
},
80104
},
81105
{
@@ -89,10 +113,38 @@ deployDocs?.addJob('deploy-docs', {
89113
},
90114
},
91115
{
92-
run: 'pip install mkdocs-material',
116+
name: 'Install doc generations dependencies',
117+
run: [
118+
'pip install --upgrade pip',
119+
'pip install -r docs/requirements.txt',
120+
].join('\n'),
121+
},
122+
{
123+
name: 'Setup docs deploy',
124+
run: [
125+
'git config user.name github-actions',
126+
'git config user.email [email protected]',
127+
].join('\n'),
93128
},
94129
{
95-
run: 'mkdocs gh-deploy --force',
130+
name: 'Get the version',
131+
id: 'getVersion',
132+
run: [
133+
'echo "version=$(git describe --tags --abbrev=0)"',
134+
'echo "version=$(git describe --tags --abbrev=0)" >> "$GITHUB_OUTPUT"',
135+
].join('\n'),
136+
},
137+
{
138+
name: 'Build and deploy documentation',
139+
env: {
140+
ALIAS: 'latest',
141+
VERSION: '${{ needs.deploy-docs.outputs.version }}',
142+
},
143+
run: [
144+
'echo ${{ env.VERSION }}',
145+
'mkdocs build',
146+
'mkdocs gh-deploy --force',
147+
].join('\n'),
96148
},
97149
],
98150
});

API.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
22
![npm](https://img.shields.io/npm/v/%40jttc%2Faws-codestarconnection)
33

4+
[![View on Construct Hub](https://constructs.dev/badge?package=%40jttc%2Faws-codestarconnection)](https://constructs.dev/packages/@jttc/aws-codestarconnection)
45
# AWS CodeStar Connection Construct Library
56

67
This package contains constructs for working with Amazon CodeStar Connection.

docs/requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
mike==1.1.2
2+
mkdocs-material==9.3.2
3+
mkdocs-git-revision-date-plugin==0.3.2
4+
mkdocs-exclude==1.0.2

mkdocs.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,3 @@ markdown_extensions:
5555
- pymdownx.snippets
5656
- attr_list
5757
- tables
58-
- pymdownx.emoji:
59-
emoji_index: !!python/name:material.extensions.emoji.twemoji
60-
emoji_generator: !!python/name:material.extensions.emoji.to_svg

0 commit comments

Comments
 (0)