Skip to content

Instantly share code, notes, and snippets.

@mayel
Created October 22, 2022 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayel/a6ca4c2d0def19600e86803232b7709c to your computer and use it in GitHub Desktop.
Save mayel/a6ca4c2d0def19600e86803232b7709c to your computer and use it in GitHub Desktop.
mix-docs-gh-pages-action.yaml
name: Generate mix docs & deploy to github pages
on:
push:
branches:
- main
jobs:
docs:
name: Generate & deploy
runs-on: ubuntu-latest
container: elixir:1.13-alpine
env:
MIX_ENV: dev
CI: true
steps:
- name: Trust my repo # see https://github.com/actions/checkout/issues/760
run: export GIT_CEILING_DIRECTORIES=/__w && git config --global --add safe.directory /__w/my-app-name/my-app-name
- name: Install hex
run: mix local.hex --force
- name: Install rebar
run: mix local.rebar --force
- name: Install dependencies
run: mix deps.get
-
name: Generate docs
run: mix docs
-
name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc
cname: docs.mydomain.org # optional
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment