diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000..005609d90 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,59 @@ +name: Docs + +on: + push: + branches: + - main + +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + runs-on: ubuntu-22.04 + env: + elixir: 1.18.1 + otp: 27.2 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Elixir + uses: erlef/setup-beam@v1 + with: + elixir-version: ${{ env.elixir }} + otp-version: ${{ env.otp }} + + - name: Restore deps and _build cache + uses: actions/cache@v4 + with: + path: | + deps + _build + key: ${{ runner.os }}-mix-${{ env.elixir }}-${{ env.otp }}-${{ hashFiles('**/mix.lock') }}-docs + restore-keys: | + ${{ runner.os }}-mix-${{ env.elixir }}-${{ env.otp }}- + - name: Install Dependencies + run: mix deps.get --only docs + + - name: Build docs + run: mix docs + + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: doc/ + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{steps.deployment.outputs.page_url}} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2