File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ name: Continuous Integration
22
33on :
44 schedule :
5+ # Run this workflow at 00:00 on every Monday
56 - cron : " 0 0 * * MON"
67 push :
78 branches : [ master ]
1011 workflow_dispatch :
1112
1213jobs :
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
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
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ name: Docker CI/CD
22
33on :
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
You can’t perform that action at this time.
0 commit comments