Skip to content

Commit b6d5f2e

Browse files
committed
CI: Add comments to workflows as per @aornugent comments
1 parent 0e7353f commit b6d5f2e

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Continuous Integration
22

33
on:
44
schedule:
5+
# Run this workflow at 00:00 on every Monday
56
- cron: "0 0 * * MON"
67
push:
78
branches: [ master ]
@@ -10,8 +11,8 @@ on:
1011
workflow_dispatch:
1112

1213
jobs:
13-
ci:
14-
name: CI
14+
build-test-taswira:
15+
name: Build and Test Taswira
1516
runs-on: ubuntu-latest
1617

1718
steps:
@@ -38,12 +39,14 @@ jobs:
3839
# Increase this value to reset cache if environment.yml has not changed
3940
CACHE_NUMBER: 0
4041
with:
42+
# Cache the path where dependencies are installed with a key unique to the existing environment.yml
4143
path: /usr/local/miniconda/envs/taswira
4244
key:
4345
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
4446
id: envcache
4547

4648
- name: Update Conda Environment
49+
# Setup (or update) the environment for faster installs
4750
run: mamba env update -n taswira -f environment.yml
4851

4952
- name: Install Python package
@@ -60,6 +63,7 @@ jobs:
6063
6164
- name: Test
6265
shell: bash -l {0}
66+
# Test the package
6367
run: |
6468
conda activate taswira
65-
python -m pytest
69+
python -m pytest

.github/workflows/docker.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Docker CI/CD
22

33
on:
44
schedule:
5+
# Run this workflow at 00:00 on every Monday
56
- cron: "0 0 * * MON"
67
pull_request:
78
branches: [ master ]
@@ -40,15 +41,18 @@ jobs:
4041
- name: Extract Docker metadata
4142
id: meta
4243
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
44+
# It will push the image to ghcr.io/moja-global/taswira:master on push
4345
with:
4446
images: ${{ env.REGISTRY }}/moja-global/taswira
4547

4648
- name: Build and push Docker image
4749
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
4850
with:
4951
context: .
52+
# Prevent push to GHCR on pull requests
5053
push: ${{ github.event_name != 'pull_request' }}
5154
tags: ${{ steps.meta.outputs.tags }}
5255
labels: ${{ steps.meta.outputs.labels }}
56+
# Implement Docker build caching for faster builds
5357
cache-from: type=gha
5458
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)