Skip to content

Commit

Permalink
Fix Docs in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
maennchen committed Mar 1, 2022
1 parent 4a7c3e1 commit bce22ac
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/branch_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ jobs:
secrets:
CACHE_VERSION: "${{ secrets.CACHE_VERSION }}"

docs:
name: "Docs"

needs: ['detectToolVersions']

uses: maennchen/athena/.github/workflows/part_docs.yml@main
with:
elixirVersion: "${{ needs.detectToolVersions.outputs.elixirVersion }}"
otpVersion: "${{ needs.detectToolVersions.outputs.otpVersion }}"
secrets:
CACHE_VERSION: "${{ secrets.CACHE_VERSION }}"

deploy:
name: "Deploy"

Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/part_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
on:
workflow_call:
inputs:
elixirVersion:
required: true
type: string
otpVersion:
required: true
type: string
releaseName:
required: false
type: string
secrets:
CACHE_VERSION:
required: true

name: "Documentation"

env:
BUILD_EMBEDDED: true

jobs:
generate:
name: "Generate"

runs-on: ubuntu-latest

env:
MIX_ENV: dev

steps:
- uses: actions/checkout@v2
- uses: erlef/setup-elixir@v1
id: setupBEAM
with:
otp-version: ${{ inputs.otpVersion }}
elixir-version: ${{ inputs.elixirVersion }}
- uses: actions/cache@v2
with:
path: deps
key: deps-${{ secrets.CACHE_VERSION }}-${{ runner.os }}-${{ steps.setupBEAM.outputs.elixir-version }}-${{ hashFiles('mix.lock') }}
restore-keys: |
deps-${{ secrets.CACHE_VERSION }}-${{ runner.os }}-${{ steps.setupBEAM.outputs.elixir-version }}-
- run: mix deps.get
- uses: actions/cache@v2
with:
path: _build/dev
key: compile-${{ env.MIX_ENV }}-${{ secrets.CACHE_VERSION }}-${{ runner.os }}-${{ steps.setupBEAM.outputs.elixir-version }}-${{ hashFiles('mix.lock') }}
restore-keys: |
compile-${{ env.MIX_ENV }}-${{ secrets.CACHE_VERSION }}-${{ runner.os }}-${{ steps.setupBEAM.outputs.elixir-version }}-
- run: mix deps.compile
- run: mix compile --warning-as-errors
- run: mix docs
- uses: actions/upload-artifact@v2
with:
name: docs
path: doc

upload:
name: "Upload"

runs-on: ubuntu-latest

if: ${{ inputs.releaseName }}

needs: ['generate']

permissions:
contents: write

steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: docs
path: docs
- run: |
tar -czvf docs.tar.gz docs
- name: Upload
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh release upload --clobber "${{ inputs.releaseName }}" \
docs.tar.gz
12 changes: 12 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ jobs:
secrets:
CACHE_VERSION: "${{ secrets.CACHE_VERSION }}"

docs:
name: "Docs"

needs: ['detectToolVersions']

uses: maennchen/athena/.github/workflows/part_docs.yml@main
with:
elixirVersion: "${{ needs.detectToolVersions.outputs.elixirVersion }}"
otpVersion: "${{ needs.detectToolVersions.outputs.otpVersion }}"
secrets:
CACHE_VERSION: "${{ secrets.CACHE_VERSION }}"

dependabot:
name: "Dependabot"

Expand Down

0 comments on commit bce22ac

Please sign in to comment.