Skip to content

Commit

Permalink
CI: Add comments to workflows as per @aornugent comments
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshCasper committed Mar 11, 2022
1 parent 0e7353f commit b6d5f2e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Continuous Integration

on:
schedule:
# Run this workflow at 00:00 on every Monday
- cron: "0 0 * * MON"
push:
branches: [ master ]
Expand All @@ -10,8 +11,8 @@ on:
workflow_dispatch:

jobs:
ci:
name: CI
build-test-taswira:
name: Build and Test Taswira
runs-on: ubuntu-latest

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

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

- name: Install Python package
Expand All @@ -60,6 +63,7 @@ jobs:
- name: Test
shell: bash -l {0}
# Test the package
run: |
conda activate taswira
python -m pytest
python -m pytest
4 changes: 4 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Docker CI/CD

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

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

0 comments on commit b6d5f2e

Please sign in to comment.