1
0
Fork 0
mirror of https://github.com/external-secrets/external-secrets.git synced 2024-12-14 11:57:59 +00:00

fix: keep docs files

This commit is contained in:
Moritz Johner 2021-05-03 22:11:25 +02:00
parent 771334dee9
commit 9af04d3bcf
2 changed files with 7 additions and 66 deletions

View file

@ -1,40 +0,0 @@
#!/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
remote_repo="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git config --global user.name "$GITHUB_ACTOR"
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
# clone gh pages, save helm index
git clone --branch=gh-pages --depth=1 "${remote_repo}" gh-pages
cd gh-pages
temp_worktree=$(mktemp -d)
if [ -f index.yaml ]; then
cp --force "index.yaml" "$temp_worktree/index.yaml"
fi
git rm -r .
# copy new page content, restore helm index, add cname
cp -r ../site/* .
if [ -f $temp_worktree/index.yaml ]; then
cp "$temp_worktree/index.yaml" .
fi
echo "${CNAME}" > CNAME
# commit & push
git add .
git commit -m "Deploy GitHub Pages"
git push --force "${remote_repo}" gh-pages

View file

@ -18,32 +18,13 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
- name: Find the Go Cache
id: go
run: |
echo "::set-output name=build-cache::$(go env GOCACHE)"
echo "::set-output name=mod-cache::$(go env GOMODCACHE)"
- name: Cache the Go Build Cache
uses: actions/cache@v2.1.5
with:
path: ${{ steps.go.outputs.build-cache }}
key: ${{ runner.os }}-build-check-diff-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-build-check-diff-
- name: Cache Go Dependencies
uses: actions/cache@v2.1.5
with:
path: ${{ steps.go.outputs.mod-cache }}
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
- name: Build Docs
run: make docs
# we can not use peaceiris/actions-gh-pages as it would override helm index
- name: Deploy Docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CNAME: external-secrets.io
run: .github/actions/docs/push.sh
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.8.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
cname: external-secrets.io
keep_files: true