Skip to content

Commit e3ba11c

Browse files
BennyDeBock0xTim
andauthored
Enhancement/deploy to s3 - Add deployment to S3
* Create deployment stack file for cloudformation * Add deployment script * Add custom 404 page * Install couscous manually in deploy workflow * Add missing sudo statement to chmod command * Add project board workflow (vapor#649) * Add i18n Support (vapor#650) * Add i18n support * Update requirements.txt to include i18n package * Update Readme to include explanation for contributing * Update styling and include mistakes section * Apply suggestions from code review * Update per PR changes Co-authored-by: Tim Condon <[email protected]> * Remove plugin for now * Reenable plugin * Plugin broke search * Update mkdocs material requirement to be version 7.1 or higher * remove google analytics. Use highlight for code blocks. Include search in plugins * Add css file for code block customisation possiblities Co-authored-by: Tim Condon <[email protected]>
1 parent c9a202f commit e3ba11c

File tree

6 files changed

+1541
-44
lines changed

6 files changed

+1541
-44
lines changed

.github/workflows/deploy.yml

+57-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,62 @@
1-
name: deploy
1+
name: Build and deploy the Vapor documentation
22
on:
33
push:
44
branches:
55
- main
66
jobs:
7-
deploy:
8-
name: docs.vapor.codes
9-
runs-on: ubuntu-latest
10-
steps:
11-
- name: Deploy docs
12-
uses: appleboy/ssh-action@master
13-
with:
14-
host: vapor.codes
15-
username: vapor
16-
key: ${{ secrets.VAPOR_CODES_SSH_KEY }}
17-
script: ./github-actions/deploy-docs.sh
7+
deploy:
8+
name: Build and deploy
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v3
13+
- name: Install dependencies
14+
run: |
15+
composer global require couscous/couscous
16+
pip install -r requirements.txt
17+
18+
curl -OSL https://couscous.io/couscous.phar
19+
sudo chmod +x couscous.phar
20+
sudo mv couscous.phar /usr/local/bin/couscous
21+
- name: Build the website
22+
run: |
23+
bash ./build.sh
24+
- name: Configure AWS credentials
25+
id: cred
26+
uses: aws-actions/configure-aws-credentials@v1
27+
with:
28+
aws-access-key-id: ${{ secrets.DOCS_DEPLOYER_AWS_ACCESS_KEY_ID }}
29+
aws-secret-access-key: ${{ secrets.DOCS_DEPLOYER_AWS_SECRET_ACCESS_KEY }}
30+
aws-region: 'eu-west-2'
31+
- name: Deploy to AWS Cloudformation
32+
id: clouddeploy
33+
if: steps.cred.outcome == 'success'
34+
uses: aws-actions/[email protected]
35+
with:
36+
name: vapor-docs-stack
37+
template: stack.yml
38+
no-fail-on-empty-changeset: "1"
39+
parameter-overrides: >-
40+
DomainName=docs.vapor.codes,
41+
S3BucketName=vapor-docs-site,
42+
AcmCertificateArn=${{ secrets.CERTIFICATE_ARN }}
43+
- name: Deploy to S3
44+
id: s3deploy
45+
if: steps.clouddeploy.outcome == 'success'
46+
uses: jakejarvis/s3-sync-action@master
47+
with:
48+
args: --acl public-read --follow-symlinks --delete
49+
env:
50+
AWS_S3_BUCKET: 'vapor-docs-site'
51+
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOYER_AWS_ACCESS_KEY_ID }}
52+
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOYER_AWS_SECRET_ACCESS_KEY }}
53+
AWS_REGION: 'eu-west-2'
54+
SOURCE_DIR: 'site'
55+
- name: Invalidate CloudFront
56+
uses: awact/cloudfront-action@master
57+
env:
58+
SOURCE_PATH: '/*'
59+
AWS_REGION: 'eu-west-2'
60+
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOYER_AWS_ACCESS_KEY_ID }}
61+
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOYER_AWS_SECRET_ACCESS_KEY }}
62+
DISTRIBUTION_ID: ${{ secrets.DOCS_DISTRIBUTION_ID }}

4.0/docs/stylesheets/extra.css

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
:root > * {
3+
--md-code-hl-number-color: #FF0000;
4+
--md-code-hl-special-color: #FF0000;
5+
--md-code-hl-function-color: #FF0000;
6+
--md-code-hl-constant-color: #FF0000;
7+
--md-code-hl-keyword-color: #FF0000;
8+
--md-code-hl-string-color: #FF0000;
9+
--md-code-hl-name-color: #FF0000;
10+
--md-code-hl-operator-color: #FF0000;
11+
--md-code-hl-punctuation-color: #FF0000;
12+
--md-code-hl-comment-color: #FF0000;
13+
--md-code-hl-generic-color: #FF0000;
14+
--md-code-hl-variable-color: #FF0000;
15+
16+
--md-code-fg-color: #FF0000;
17+
--md-code-bg-color: #FF0000;
18+
--md-code-hl-color: #FF0000;
19+
}
20+
*/

4.0/mkdocs.yml

+34-31
Original file line numberDiff line numberDiff line change
@@ -43,46 +43,49 @@ extra:
4343
- icon: fontawesome/brands/github
4444
link: https://github.com/vapor
4545

46-
# Google Analytics
47-
google_analytics:
48-
- UA-76177358-4
49-
- auto
46+
# Custom code highlighting syntax (uncomment if you want to use this. css is in `docs/stylesheets/extra.css`)
47+
# extra_css:
48+
# - stylesheets/extra.css
5049

5150
# Extensions
5251
markdown_extensions:
5352
- admonition
54-
- codehilite:
55-
guess_lang: false
53+
- pymdownx.highlight:
54+
use_pygments: false
55+
- pymdownx.inlinehilite
56+
- pymdownx.snippets
57+
- pymdownx.superfences
5658
- footnotes
5759
- meta
5860
- toc:
5961
permalink: true
6062

61-
# # Plugins
62-
# plugins:
63-
# # i18n plugin documentation
64-
# # https://github.com/ultrabug/mkdocs-static-i18n
65-
# - i18n:
66-
# default_language: 'en'
67-
# # Add the new languages here. DON'T CHANGE THE DEFAULT LANGUAGE
68-
# languages:
69-
# en:
70-
# name: English
71-
# build: true
72-
# nl:
73-
# name: Nederlands
74-
# site_name: Vapor Documentatie
75-
# build: true
76-
# fr:
77-
# name: Français
78-
# site_name: Documentation Vapor
79-
# build: true
80-
# # Add navigation translations here
81-
# nav_translations:
82-
# nl:
83-
# Welcome: Welkom
84-
# fr:
85-
# Welcome: Bienvenue
63+
# Plugins
64+
plugins:
65+
- search
66+
# i18n plugin documentation
67+
# https://github.com/ultrabug/mkdocs-static-i18n
68+
- i18n:
69+
default_language: 'en'
70+
# Add the new languages here. DON'T CHANGE THE DEFAULT LANGUAGE
71+
languages:
72+
en:
73+
name: English
74+
build: true
75+
nl:
76+
name: Nederlands
77+
site_name: Vapor Documentatie
78+
build: true
79+
fr:
80+
name: Français
81+
site_name: Documentation Vapor
82+
build: true
83+
# Add navigation translations here
84+
nav_translations:
85+
nl:
86+
Welcome: Welkom
87+
fr:
88+
Welcome: Bienvenue
8689

8790

8891
nav:

0 commit comments

Comments
 (0)