deploy #1102
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy-main | |
on: | |
push: | |
branches: | |
- main | |
- release-* | |
schedule: | |
# At 03:45 each day | |
- cron: "45 3 * * *" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: npm | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: pip | |
cache-dependency-path: requirements.txt | |
- name: Install Node dependencies | |
run: npm ci | |
- name: Install Python dependencies | |
run: python3 -m pip install -r ./requirements.txt | |
- name: Configure Git user | |
run: | | |
git config --local user.email "${GITHUB_ACTOR}@users.noreply.${GITHUB_DOMAIN:-"github.com"}" | |
git config --local user.name "${GITHUB_ACTOR}" | |
- name: Configure Git user | |
run: git fetch origin gh-pages --depth=1 | |
- name: Show CI environment for debugging | |
run: | | |
set -x | |
id | |
pwd | |
git log -1 | |
git status | |
cat /etc/lsb-release | |
dpkg -l | |
npm version | |
npm ls | |
python3 --version | |
pip3 list | |
set +x | |
- name: Auto-generate documentation | |
run: ./scripts/jsonschema2md.sh | |
- name: Deploy with mike | |
run: | | |
if [ "$GITHUB_REF_NAME" == "main" ]; then | |
# Latest version of the docs goes under https://elastisys.io/compliantkubernetes | |
VERSION_TITLE="main" | |
VERSION="compliantkubernetes ck8s" | |
else | |
# Other versions go under https://elastisys.io/compliantkubernetes-v0.25/ | |
VERSION_TITLE=$(echo "$GITHUB_REF_NAME" | cut -d- -f2) | |
VERSION="compliantkubernetes-${VERSION_TITLE}" | |
fi | |
echo version: $VERSION version-title: $VERSION_TITLE | |
mike deploy $VERSION -t $VERSION_TITLE --template overrides/redirect.html | |
mike set-default compliantkubernetes --push --template overrides/redirect.html |