Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undockerize local & CI site builds #634

Merged
merged 4 commits into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,18 @@ jobs:
uses: actions/setup-python@41b7212b1668f5de9d65e9c82aa777e6bbedb3a8 # v2.1.4
with:
python-version: '3.6'
- name: 🐳 Build Docker image
run: ./site.sh build-image
- name: 🟢 Install node depedencies
- name: ❤️ Install Node 16
uses: actions/[email protected] # v3.3.0
with:
node-version: 16
- name: 📚 Install Hugo
uses: peaceiris/[email protected] # v2.4.13
with:
hugo-version: '0.91.2'
extended: true
- name: 🟢 Install node dependencies
run: ./site.sh install-node-deps
- name: 🐍 Install Python depedencies
- name: 🐍 Install Python dependencies
run: pip install -r requirements.txt
- name: 🔎 Lint
uses: apache/airflow-pre-commit-action@0764670bf370aab253130d534e1eda7ff497dc60 # v2.0.0
Expand All @@ -61,7 +68,7 @@ jobs:
path: './dist'
if-no-files-found: error
retention-days: 14
- name: 👷🏻 Copy .asf.yaml to /dist/
- name: 👷 Copy .asf.yaml to /dist/
if: ${{ github.event_name == 'push' }}
run: |
# The asf.yaml file must be in the branch from which the files are published.
Expand Down
42 changes: 35 additions & 7 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ be done by the site.sh script
The following applications must be installed to use the project:

* git
* docker
* docker (for the shell language linter)
* Node 16
* Hugo

It is also worth adding SSH keys for the `github.com` server to trusted ones. It is necessary to clone repositories. You can do this using following command:
```bash
Expand All @@ -91,6 +93,37 @@ git config --global user.email '<[email protected]>'
git config --global user.name '<you name>'
```

To install Node 16, first install the [Node version manager](https://github.com/nvm-sh/nvm), `nvm`. Then, install Node 16 with these commands:

```bash
nvm install 16
nvm use 16
```

To install hugo on Debian, run the following command:
```bash
sudo apt install hugo -y
```

**macOS installation**

To install git on macOS, install the XCode Command Line Tools with the following command:
```bash
xcode-select --install
```

Then, install [Homebrew](https://brew.sh). Once that has completed, you can install Hugo:
```bash
brew install hugo
```

To install Node 16, first install the [Node version manager](https://github.com/nvm-sh/nvm), `nvm`. Then, install Node 16 with these commands:

```bash
nvm install 16
nvm use 16
```

### Static checks

The project uses many static checks using fantastic [pre-commit](https://pre-commit.com/). Every change is checked on CI and if it does not pass the tests it cannot be accepted. If you want to check locally then you should install Python3.6 or newer together with pip and run following command to install pre-commit:
Expand Down Expand Up @@ -127,23 +160,18 @@ git submodule update --init --recursive

### Use `site.sh` script

In order to run an environment for the project, make sure that you have Docker installed. Then, use the `site.sh`
script to work with the website in a Docker container.
In order to manage your local environment for the project, use the `site.sh` script.

`site.sh` provides the following commands.

build-site Prepare dist directory with landing pages and documentation
preview-landing-pages Starts the web server with preview of the website
build-landing-pages Builds a landing pages
prepare-theme Prepares and copies files needed for the proper functioning of the sphinx theme.
shell Start shell
build-image Build a Docker image with a environment
install-node-deps Download all the Node dependencies
check-site-links Checks if the links are correct in the website
lint-css Lint CSS files
lint-js Lint Javascript files
cleanup Delete the virtual environment in Docker
stop Stop the environment
help Display usage

### How to add a new blogpost
Expand Down
2 changes: 2 additions & 0 deletions dump-docs-packages-metadata.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python

import json
import sys

Expand Down
2 changes: 1 addition & 1 deletion landing-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"file-loader": "^4.1.0",
"imports-loader": "^0.8.0",
"mini-css-extract-plugin": "^0.8.0",
"node-sass": "^4.12.0",
"npm-run-all": "^4.1.5",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"plugin-error": "^1.0.1",
Expand All @@ -59,6 +58,7 @@
"postcss-loader": "^3.0.0",
"postcss-preset-env": "^6.7.0",
"rimraf": "^3.0.0",
"sass": "^1.53.0",
"sass-loader": "^7.1.0",
"style-loader": "^1.0.0",
"stylelint": "^11.0.0",
Expand Down
Loading