Skip to content

Update getting-started.md #18

Update getting-started.md

Update getting-started.md #18

name: Build and Deploy
on:
push: ~
workflow_dispatch: ~
jobs:
build-and-deploy:
runs-on: ubuntu-latest
container: strongboxci/mkdocs:base
env:
# DEPLOY_URL=https://strongbox.github.io, but it's a "secrets" to allow easier changing if necesary without changing the code.
DEPLOY_URL: "${{ secrets.DEPLOY_URL }}"
GOOGLE_ANALYTICS_KEY: "${{ secrets.GOOGLE_ANALYTICS_KEY }}"
steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
- name: Get short SHA
id: slug
run: echo "::set-output name=short_sha::$(echo ${GITHUB_SHA} | cut -c1-7)"
- name: Build
run: mkdocs build
- name: Setup upstream
if: github.ref == 'refs/heads/master'
run: |
git config user.name "${{ secrets.GH_USER }}"
git config user.email "${{ secrets.GH_EMAIL }}"
git remote add strongbox.github.io "https://${{ secrets.GH_TOKEN }}@github.com/strongbox/strongbox.github.io"
git fetch strongbox.github.io
- name: Prepare built assets
if: github.ref == 'refs/heads/master'
run: |
git checkout --orphan gh-pages
find . -maxdepth 1 ! -name "site" ! -name ".git*" ! -name "." -exec git rm -rf {} \;
git add --force site
git commit -m "strongbox/strongbox-docs#${{ steps.slug.outputs.short_sha }}: ${{ github.event.head_commit.message }}"
git log -n 1 --format=oneline
- name: Deploy
if: github.ref == 'refs/heads/master'
run: |
git push strongbox.github.io `git subtree split --prefix site gh-pages`:master --force