Skip to content

Commit

Permalink
Use native copy (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Nov 12, 2020
1 parent 45b1e32 commit 6963e12
Show file tree
Hide file tree
Showing 6 changed files with 337 additions and 3,248 deletions.
55 changes: 52 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -11,15 +11,62 @@ on:
jobs:
ci:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target_branch: 'gh-pages'
keep_history: 'false'
- target_branch: 'gh-pages-keep'
keep_history: 'true'
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Gen dummy page
name: Init
run: |
sudo apt-get install tree
mkdir public
touch public/file{0001..3000}
-
name: Gen dummy files and folders
run: |
MAXDIRS=5
MAXDEPTH=5
MAXFILES=10
MAXSIZE=1000
TOP=$(pwd|tr -cd '/'|wc -c)
populate() {
cd $1
curdir=$PWD
files=$(($RANDOM*$MAXFILES/32767))
for n in $(seq $files)
do
f=$(mktemp XXXXXX)
size=$(($RANDOM*$MAXSIZE/32767))
head -c $size /dev/urandom > $f
done
depth=$(pwd | tr -cd '/' | wc -c)
if [ $(($depth-$TOP)) -ge $MAXDEPTH ]
then
return
fi
unset dirlist
dirs=$(($RANDOM*$MAXDIRS/32767))
for n in $(seq $dirs); do
d=`mktemp -d XXXXXX`
dirlist="$dirlist${dirlist:+ }$PWD/$d"
done
for dir in $dirlist; do
populate "$dir"
done
}
populate $PWD/public
-
name: Gen dummy page
run: |
cat > public/index.html <<EOL
<!doctype html>
<html>
Expand All @@ -31,6 +78,7 @@ jobs:
</body>
</html>
EOL
tree -f -h ./public
-
name: Check GitHub Pages status
uses: crazy-max/ghaction-github-status@v2
Expand All @@ -41,7 +89,8 @@ jobs:
if: success()
uses: ./
with:
target_branch: gh-pages
target_branch: ${{ matrix.target_branch }}
keep_history: ${{ matrix.keep_history }}
build_dir: public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 6963e12

Please sign in to comment.