test/.github/workflows/pages.yml
2020-03-09 21:10:48 -05:00

41 lines
1.1 KiB
YAML

name: CI
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: push content
run: |
REMOTE="https://${GITHUB_PAT}@github.com/${GITHUB_REPOSITORY}.git"
COMMITER_NAME="${GITHUB_ACTOR}-github-actions"
COMMITER_EMAIL="${GITHUB_ACTOR}-@users.noreply.github.com"
echo "COMMITER_NAME: ${COMMITER_NAME}"
echo "COMMITER_EMAIL: ${COMMITER_EMAIL}"
echo "REMOTE: ${REMOTE}"
mkdir /tmp/github-pages
cd /tmp/github-pages
git init .
git checkout --orphan gh-pages
git status --short
# git ls-remote --heads ${REMOTE} gh-pages
echo "<h1>hello there</h1>" > index.html
git config user.name ${COMMITER_NAME}
git config user.email ${COMMITER_EMAIL}
git status --porcelain
git add --all .
git commit commit -m "DIST to gh-pages"
git push --quiet --force ${REMOTE} gh-pages
env:
GITHUB_PAT: ${{ secrets.GITHUB_PAT }}