|
| 1 | +# This is a basic workflow to help you get started with Actions |
| 2 | + |
| 3 | +name: Buid and Deploy |
| 4 | + |
| 5 | +# Controls when the action will run. |
| 6 | +on: |
| 7 | + # Triggers the workflow on push or pull request events but only for the master branch |
| 8 | + push: |
| 9 | + branches: [ master ] |
| 10 | + pull_request: |
| 11 | + branches: [ master ] |
| 12 | + |
| 13 | + # Allows you to run this workflow manually from the Actions tab |
| 14 | + workflow_dispatch: |
| 15 | + |
| 16 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 17 | +jobs: |
| 18 | + # This workflow contains a single job called "build" |
| 19 | + build-and-deploy: |
| 20 | + # The type of runner that the job will run on |
| 21 | + runs-on: ubuntu-latest |
| 22 | + |
| 23 | + # Steps represent a sequence of tasks that will be executed as part of the job |
| 24 | + steps: |
| 25 | + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| 26 | + - name: Checkout |
| 27 | + uses: actions/checkout@v2 |
| 28 | + with: |
| 29 | + persist-credentials: false |
| 30 | + # Runs a set of commands using the runners shell |
| 31 | + - name: Setup Mkdocs |
| 32 | + uses: conda-incubator/setup-miniconda@v2 |
| 33 | + with: |
| 34 | + miniconda-version: "latest" |
| 35 | + activate-environment: foo |
| 36 | + - name: Bash |
| 37 | + shell: bash -l {0} |
| 38 | + run: | |
| 39 | + conda install python=3 pip |
| 40 | + pip install mkdocs mkdocs-material |
| 41 | + mkdocs -h |
| 42 | + mkdir -p docs/styles |
| 43 | + mkdir -p docs/assets |
| 44 | + mkdir -p mkdocs_build |
| 45 | + curl https://gist.githubusercontent.com/fernandogelin/08ecff3387dffc374c4abf06a577ab71/raw/29ad95fcc771ce49ff6cecc56346218a0e929df8/dark_mode.css > docs/styles/dark_mode.css |
| 46 | + curl https://gist.githubusercontent.com/fernandogelin/b02ee98f2f35ce4263093f7a1c66582b/raw/20ca5a37eb6defe00d35e50e7e00a784b64309f9/cbc-logo.svg > docs/assets/cbc-logo.svg |
| 47 | + mkdocs build -d mkdocs_build --verbose --clean --strict |
| 48 | + - name: Deploy |
| 49 | + uses: JamesIves/github-pages-deploy-action@3.7.1 |
| 50 | + with: |
| 51 | + GITHUB_TOKEN: ${{ secrets.GHPAGES_MKDOCS }} |
| 52 | + BRANCH: gh-pages # The branch the action should deploy to. |
| 53 | + FOLDER: mkdocs_build # The folder the action should deploy. |
| 54 | + CLEAN: true # Automatically remove deleted files from the deploy branch |
0 commit comments