Skip to content

Commit ffa27e5

Browse files
committed
Trying to make doc gen work.
1 parent 4af0ceb commit ffa27e5

File tree

1 file changed

+40
-4
lines changed

1 file changed

+40
-4
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,25 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17+
# Step 1: Check out the code
1718
- name: Check out the code
1819
uses: actions/checkout@v4
1920
with:
2021
fetch-depth: 0 # Fetch all history for all branches
2122
ref: main # Ensure main branch is checked out
2223

24+
# Step 2: Set up Elixir
2325
- name: Set up Elixir
2426
uses: erlef/setup-beam@v1
2527
with:
2628
elixir-version: '1.17'
2729
otp-version: '27.1.2'
2830

31+
# Step 3: Install dependencies
2932
- name: Install dependencies
3033
run: mix deps.get
3134

32-
# If the key doesn’t change, the cache will persist as long as it’s used within a 7-day period.
33-
# If the cache isn’t accessed within 7 days, GitHub will expire it, even if the key hasn’t changed.
34-
35+
# Step 4: Cache dependencies
3536
- name: Cache dependencies
3637
uses: actions/cache@v3
3738
with:
@@ -40,6 +41,7 @@ jobs:
4041
restore-keys: |
4142
${{ runner.os }}-mix-
4243
44+
# Step 5: Cache Dialyzer PLT
4345
- name: Cache Dialyzer PLT
4446
uses: actions/cache@v3
4547
with:
@@ -48,33 +50,67 @@ jobs:
4850
restore-keys: |
4951
${{ runner.os }}-dialyzer-plt-
5052
53+
# Step 6: Run formatter check
5154
- name: Run formatter check
5255
run: mix format --check-formatted
5356

57+
# Step 7: Run Credo for linting
5458
- name: Run Credo for linting
5559
run: mix credo --strict
5660

61+
# Step 8: Run Dialyzer for type checking
5762
- name: Run Dialyzer for type checking
5863
run: mix dialyzer
5964
env:
6065
MIX_ENV: dev
6166

67+
# Step 9: Run tests
6268
- name: Run tests
6369
run: mix test
6470

71+
# Step 10: Print Environment (Debugging)
72+
- name: Print Environment
73+
run: env
74+
75+
# Step 11: Print Working Directory (Debugging)
76+
- name: Print Working Directory
77+
run: pwd
78+
79+
# Step 12: List Files (Debugging)
80+
- name: List Files
81+
run: ls -la
82+
83+
# Step 13: Debug Environment
84+
- name: Debug Environment
85+
run: |
86+
cd $GITHUB_WORKSPACE # Ensure we're in the root directory
87+
mix deps.get
88+
mix help docs
89+
ls -la doc/
90+
env:
91+
MIX_ENV: dev
92+
93+
# Step 14: Generate documentation
6594
- name: Generate documentation
95+
working-directory: ${{ github.workspace }} # Ensure this is run in the root directory
6696
run: mix docs
97+
env:
98+
MIX_ENV: dev
6799

100+
# Step 15: Upload documentation as an artifact
68101
- name: Upload documentation
69102
uses: actions/upload-artifact@v3
70103
with:
71104
name: documentation
72105
path: doc/
73106

107+
# Step 16: Deploy to GitHub Pages
74108
- name: Deploy to GitHub Pages
109+
env:
110+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75111
run: |
76112
git config --global user.name "GitHub Actions"
77113
git config --global user.email "[email protected]"
78114
git add doc/
79115
git commit -m "Update documentation [skip ci]" || echo "No changes to commit"
80-
git push origin main
116+
git push origin main

0 commit comments

Comments
 (0)