Skip to content

Add changelog notes for recent docs PRs #51

Add changelog notes for recent docs PRs

Add changelog notes for recent docs PRs #51

name: Refresh Dev Cache ♻️
# We need this workflow to ensure that MIX_ENV=docs caches are available when
# the CI workflow runs for a tagged build. This is due to a combination of
# several factors, so it's worthy of a wordy explanation.
#
# The actions/cache step stores the caches per-branch and if the cache key misses
# for a branch, it will try to find a cache from its default branch (main).
# So, when we run CI for a new branch or a new tag, there will be a cache miss
# and the cache step will try to find a cache from the main branch.
# The problem is, we only build with MIX_ENV=docs when a tag is pushed. That
# means our main CI workflow never builds a docs cache in the main branch.
# When we push a new tag for a release, the actions/cache step will always miss
# and then check main for a docs cache. We need this workflow to ensure that
# it will find a recent docs cache.
#
# Many of the steps are duplicated between this workflow and the
# publish-hex-package job in the Actions CI workflow.
on:
push:
branches:
- main
# Would like to run this as a scheduled workflow, but that is not currently
# supported by the actions/cache action.
env:
CUATRO_HEX_KEY: ${{ secrets.CUATRO_HEX_KEY }}
jobs:
refresh-docs-cache:
name: Refresh Docs Cache
runs-on: ubuntu-latest
env:
MIX_ENV: docs
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Determine the elixir version
run: echo "ELIXIR_VERSION=$(grep -h elixir .tool-versions | awk '{ print $2 }' | awk -F - '{print $1}')" >> $GITHUB_ENV
- name: Determine the otp version
run: echo "OTP_VERSION=$(grep -h erlang .tool-versions | awk '{ print $2 }')" >> $GITHUB_ENV
- name: Setup Elixir and Erlang versions
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ env.ELIXIR_VERSION }}
otp-version: ${{ env.OTP_VERSION }}
- name: Restore the deps cache
uses: actions/cache@v4
id: deps-cache
with:
path: deps
key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-
- name: Restore the _build cache
uses: actions/cache@v4
id: build-cache
with:
path: _build
key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-build-mixlockhash-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-build-
- name: Fetch mix dependencies
if: steps.deps-cache.outputs.cache-hit != 'true'
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Compile dependencies
if: steps.deps-cache.outputs.cache-hit != 'true'
run: mix deps.compile
- name: Compile application
run: mix compile
- name: Build Dialyzer PLT File
run: mix dialyzer --plt
# Generated by Elixir.Gaas.Generators.Simple.Actions.RefreshDevCache