Skip to content
Permalink
Browse files
[website] use GH_TOKEN to push to asf-site and asf-staging branches (#…
  • Loading branch information
nicoloboschi committed Mar 18, 2022
1 parent 7d32683 commit 8a780caf00e7874053a8cc81e7596f9d92b05a07
Showing 4 changed files with 6 additions and 5 deletions.
@@ -29,6 +29,7 @@ on:
jobs:
build-website:
name: Build and publish website
if: ${{ github.repository == 'apache/bookkeeper' }}
runs-on: ubuntu-latest
timeout-minutes: 180
steps:
@@ -33,6 +33,7 @@ env:
jobs:
stage-website:
name: Build and stage website
if: ${{ github.repository == 'apache/bookkeeper' }}
runs-on: ubuntu-latest
timeout-minutes: 180
steps:
@@ -21,6 +21,8 @@
# NOTE: this is the script used by CI to push to apache. If you are looking for
# staging the changes, try the `staging-website.sh` script.
source scripts/common.sh
ORIGIN_REPO=$(git remote show origin | grep 'Push URL' | awk -F// '{print $NF}')
echo "ORIGIN_REPO: $ORIGIN_REPO"

(
cd $APACHE_GENERATED_DIR
@@ -30,11 +32,9 @@ source scripts/common.sh
cd $TMP_DIR

# clone the remote repo
# Workaround: https://stackoverflow.com/questions/22147574/fatal-could-not-read-username-for-https-github-com-no-such-file-or-directo
git clone "git@github.com:apache/bookkeeper.git" .
git clone --depth 1 -b asf-site "https://$GH_TOKEN@$ORIGIN_REPO" .
git config user.name "Apache BookKeeper Site Updater"
git config user.email "dev@bookkeeper.apache.org"
git checkout asf-site
# copy the apache generated dir
cp -r $APACHE_GENERATED_DIR/content/* $TMP_DIR/content

@@ -32,10 +32,9 @@ TMP_DIR=/tmp/bookkeeper-site
cd $TMP_DIR

# clone the remote repo
git clone "https://$ORIGIN_REPO" .
git clone --depth 1 -b asf-staging "https://$GH_TOKEN@$ORIGIN_REPO" .
git config user.name "Apache BookKeeper Site Updater"
git config user.email "dev@bookkeeper.apache.org"
git checkout asf-staging
# copy the apache generated dir
mkdir -p content
cp -r $ROOT_DIR/site3/website/build/* content

0 comments on commit 8a780ca

Please sign in to comment.