Update upload-artifact version #22
Workflow file for this run
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
name: GitHub Pages | |
on: | |
- push | |
- pull_request | |
jobs: | |
build: | |
if: ${{ !startsWith(github.event.head_commit.message, '[Skip CI]') }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- run: pip3 install --requirement requirements.txt | |
- run: make build | |
- run: make tarball | |
- run: |- | |
find _site -type f -printf 'https://tools.ashenm.dev/%P\n' | \ | |
jq --raw-input --slurp 'split("\n") | { files: .[:-1] }' | tee artifacts.list | |
- uses: actions/[email protected] | |
with: | |
name: artifacts | |
path: |- | |
artifacts.tar.bz2 | |
artifacts.list | |
runs-on: ubuntu-latest | |
deploy: | |
needs: | |
- build | |
if: ${{ github.event_name != 'pull_request' && !startsWith(github.event.head_commit.message, '[Skip Deploy]') }} | |
steps: | |
- uses: actions/[email protected] | |
with: | |
name: artifacts | |
- run: |- | |
mkdir --parent /tmp/build | |
tar --bzip --extract --file artifacts.tar.bz2 --directory /tmp/build | |
- run: |- | |
git init | |
git checkout --orphan gh-pages | |
git config user.email "[email protected]" | |
git config user.name "Ashen Gunaratne" | |
echo "tools.ashenm.dev" | tee CNAME | |
git add --all . | |
git commit --quiet --message "Deploy tools.ashenm.dev to github.com/${GITHUB_REPOSITORY}.git:gh-pages" | |
git push --force --quiet "https://${{ secrets.OCTOCAT_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" "gh-pages:gh-pages" | |
git show --stat-count=10 HEAD | |
working-directory: /tmp/build | |
runs-on: ubuntu-latest | |
culminate: | |
needs: | |
- deploy | |
steps: | |
- uses: actions/[email protected] | |
with: | |
name: artifacts | |
- run: curl --silent --fail --show-error --location --output - 'https://raw.githubusercontent.com/ashenm/tools/master/.github/scripts/culminate.sh' | sh - | |
env: | |
CLOUDFLARE_USER: ${{ secrets.CLOUDFLARE_USER }} | |
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} | |
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }} | |
runs-on: ubuntu-latest | |
# vim: set expandtab shiftwidth=2 syntax=yaml: |