chore: 🔧 Add missing users to the ignore messages list #556
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python lint and CI/CD | |
on: [push, pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- uses: isort/isort-action@master | |
with: | |
sortPaths: "./menuflow" | |
- uses: psf/black@stable | |
with: | |
src: "./menuflow" | |
version: "24.4.2" | |
- name: pre-commit | |
run: | | |
pip install pre-commit | |
pre-commit run -av trailing-whitespace | |
pre-commit run -av end-of-file-fixer | |
pre-commit run -av check-yaml | |
pre-commit run -av check-added-large-files | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- uses: actions/cache@v4 | |
id: cache | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.*') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt -r requirements-dev.txt | |
- name: Run pytest | |
run: | | |
pytest -vv | |
docker: | |
if: "github.ref_name == 'main'" | |
runs-on: ubuntu-latest | |
needs: [lint, test] | |
environment: deploy | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- | |
name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ${{ vars.MENUFLOW_IMAGE }} | |
- | |
# Download updated docker image to testing server | |
name: Connect to server and update docker image | |
run: |- | |
echo "** Connecting to testing server **" | |
# Update the apt package index | |
sudo apt-get update -qq | |
# If ssh-agent does not exist, install openssh-client | |
which ssh-agent || ( sudo apt-get install openssh-client ) | |
# Start the ssh-agent in the background | |
eval $(ssh-agent -s) | |
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store | |
ssh-add <(echo "${{ secrets.SSH_PRIVATE_KEY }}") | |
# Create the SSH config directory | |
mkdir -vp ~/.ssh | |
# Disable StrictHostKeyChecking ask in SSH config | |
[[ -e ~/.ssh ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config | |
ssh -tt ${{ secrets.HOST_TESTING }} "echo '** Connected **'" | |
echo "** Download updated docker image **" | |
# Download updated docker image to testing server | |
ssh -tt ${{ secrets.HOST_TESTING }} "docker pull ${{ vars.MENUFLOW_IMAGE }}" | |
echo "** Update menuflow image in registered stacks **" | |
for stack in ${{ vars.STACKS }}; do | |
echo " >> Setting service variables" | |
stack_name=$(echo ${stack} | tr -d '.') | |
service=$(echo ${stack} | cut -d '.' -f1) | |
menuflow_service="${stack_name}_${service}-menuflow" | |
echo " >> Remove the service if exists" | |
ssh -tt ${{ secrets.HOST_TESTING }} " \ | |
if docker service ps ${menuflow_service}; then \ | |
docker service rm ${menuflow_service}; \ | |
else \ | |
echo 'The service ${menuflow_service} is not exists'; \ | |
fi; | |
" | |
echo " >> Deploy the service" | |
docker_compose_file="/mnt/shared/matrix/${stack}/docker-compose.yml" | |
ssh -tt ${{ secrets.HOST_TESTING }} " \ | |
docker-compose -f ${docker_compose_file} config | \ | |
docker stack deploy -c - ${stack_name}; | |
" | |
done |