Skip to content

Commit

Permalink
Rework workflows (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfudeus authored May 18, 2024
1 parent e6bd7fb commit e49f09e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 111 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/docker-build-publish-branch.yaml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/docker-build-publish-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Docker Build/Publish Preview Image from PR
on:
pull_request:
branches:
- master
- main
workflow_dispatch: {}

jobs:
build:
uses: sfudeus/workflows/.github/workflows/docker-build-publish-pr.yaml@main
secrets: inherit
with:
tag: preview-${{ github.event.number }}
38 changes: 6 additions & 32 deletions .github/workflows/docker-build-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,14 @@
name: Docker Build/Publish Release
name: Docker Build/Publish Image
on:
push:
tags:
- "*"
branches:
- master
- main
schedule:
- cron: '15 6 * * 0'
workflow_dispatch: {}

jobs:
build:
runs-on: ubuntu-latest
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Define revision
id: revision
run: |
REVISION=$(date +%F)
echo "target-revision=$REVISION" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker build/push
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: |
"${{ github.repository }}:${{ steps.revision.outputs.target-revision }}"
"${{ github.repository }}:latest"
push: true
uses: sfudeus/workflows/.github/workflows/docker-build-publish-branch.yaml@main
secrets: inherit
21 changes: 0 additions & 21 deletions .github/workflows/docker-build.yaml

This file was deleted.

23 changes: 2 additions & 21 deletions .github/workflows/python-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,5 @@ on:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint wth pylint
run: pylint --rcfile pylintrc --exit-zero *.py
- name: Test with pytest
run: pytest
uses: sfudeus/workflows/.github/workflows/python-build.yaml@main
secrets: inherit

0 comments on commit e49f09e

Please sign in to comment.