forked from kubernetes/ingress-nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate release of docs from travis-ci to github actions (kubernetes#…
- Loading branch information
Showing
8 changed files
with
93 additions
and
236 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM squidfunk/mkdocs-material:4.6.3 | ||
|
||
COPY action.sh /action.sh | ||
|
||
RUN apk add --no-cache bash \ | ||
&& chmod +x /action.sh | ||
|
||
ENTRYPOINT ["/action.sh"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2020 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -e | ||
|
||
REQUIREMENTS="${GITHUB_WORKSPACE}/requirements.txt" | ||
|
||
if [ -f "${REQUIREMENTS}" ]; then | ||
pip install -r "${REQUIREMENTS}" | ||
fi | ||
|
||
if [ -n "${GITHUB_TOKEN}" ]; then | ||
remote_repo="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | ||
elif [ -n "${PERSONAL_TOKEN}" ]; then | ||
remote_repo="https://x-access-token:${PERSONAL_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | ||
fi | ||
|
||
git config --global user.name "$GITHUB_ACTOR" | ||
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" | ||
|
||
mkdocs build --config-file "${GITHUB_WORKSPACE}/mkdocs.yml" | ||
|
||
git clone --branch=gh-pages --depth=1 "${remote_repo}" gh-pages | ||
cd gh-pages | ||
|
||
# TODO: enable before release of helm chart | ||
# copy current index file index.yaml before any change | ||
#temp_worktree=$(mktemp -d) | ||
#cp --force "index.yaml" "$temp_worktree/index.yaml" | ||
# remove current content in branch gh-pages | ||
git rm -r . | ||
# copy new doc. | ||
cp -r ../site/* . | ||
# restore chart index | ||
# TODO: enable before release of helm chart | ||
#cp "$temp_worktree/index.yaml" . | ||
# commit changes | ||
git add . | ||
git commit -m "Deploy GitHub Pages" | ||
git push --force --quiet "${remote_repo}" gh-pages > /dev/null 2>&1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# action.yml | ||
name: 'Deploy MkDocs' | ||
description: 'Deploys MkDocs site' | ||
branding: | ||
icon: 'arrow-up-circle' | ||
color: 'orange' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: docs and Helm chart | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout master | ||
uses: actions/checkout@v1 | ||
|
||
#- name: Run chart-releaser | ||
# uses: helm/[email protected] | ||
# env: | ||
# CR_TOKEN: "${{ secrets.PERSONAL_TOKEN }}" | ||
|
||
- name: Deploy docs | ||
uses: ./.github/actions/mkdocs | ||
env: | ||
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.