Skip to content

Commit

Permalink
GH Actions: Added jobs for linting and building Docker image
Browse files Browse the repository at this point in the history
Signed-off-by: Grzegorz Latosinski <[email protected]>
  • Loading branch information
glatosinski committed Mar 13, 2024
1 parent 08d9f54 commit 7139d48
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 22 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and publish Docker image for the project

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
Docker:
if: github.repository == 'antmicro/dl-in-iot-course'
runs-on: ubuntu-latest
steps:
- name: Cancel previous run
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout sources
uses: actions/checkout@v4
- name: Build Docker image
run: docker build . -f environments/Dockerfile --tag ghcr.io/${{ github.repository }}
- name: Login to registry
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Push image to registry
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
run: docker push ghcr.io/${{ github.repository }}
22 changes: 0 additions & 22 deletions .github/workflows/flake8.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: pre-commit checks

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Run pre-commit
uses: pre-commit/[email protected]

0 comments on commit 7139d48

Please sign in to comment.