Skip to content

Commit

Permalink
Fix gh-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
atrakic committed Jul 10, 2024
1 parent 7772f7c commit fbcf8c9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
43 changes: 22 additions & 21 deletions .github/workflows/call-docker-build-web.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
name: Build Web
# template source: https://github.com/dockersamples/.github/blob/main/templates/call-docker-build.yaml

on:
# we want pull requests so we can build(test) but not push to image registry
push:
branches:
- 'main'
# only build when important files change
paths:
- 'src/**'
- '.github/workflows/call-docker-build-web.yaml'
pull_request:
branches:
- 'main'
# only build when important files change
paths:
- 'src/**'
- '.github/workflows/call-docker-build-web.yaml'
tags:
- '*'
workflow_dispatch:
workflow_run:
workflows: ["Test"]
types: [completed]

jobs:
call-docker-build:

name: Web Call Docker Build
docker-build:
name: Docker Build
uses: dockersamples/.github/.github/workflows/reusable-docker-build.yaml@main
if: ${{ github.event.workflow_run.conclusion == 'success' }} &&
${{ github.event.workflow_run.head_branch == 'main' }}

permissions:
contents: read
Expand All @@ -38,7 +30,6 @@ jobs:
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

with:

### REQUIRED
### ENABLE ONE OR BOTH REGISTRIES
### tell docker where to push.
Expand All @@ -56,12 +47,16 @@ jobs:
### https://github.com/docker/metadata-action#tags-input
### defaults to:
tag-rules: |
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
### path to where docker should copy files into image
### defaults to root of repository (.)
context: ./src
# context: .

### Dockerfile alternate name. Default is Dockerfile (relative to context path)
# file: Containerfile
Expand All @@ -76,3 +71,9 @@ jobs:
### Create a PR comment with image tags and labels
### defaults to false
# comment-enable: false

## Example release pipeline trigger:
#
# TAG="v0.0.1"
# git tag "$TAG" -m "Release version: $TAG"
# git push origin --tags
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install pylint pytest flake8
pip install -r ./src/requirements.txt
pip install -r ./requirements.txt
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
Expand All @@ -39,4 +39,4 @@ jobs:
- name: Running the tests
run: |
pytest -v
pytest -v
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[pytest]
; log_cli=true
; log_level=INFO
addopts = -p no:warnings
addopts = -p no:warnings

0 comments on commit fbcf8c9

Please sign in to comment.