Skip to content

chore(deps): bump actions/checkout from 5 to 6 (#126) #393

chore(deps): bump actions/checkout from 5 to 6 (#126)

chore(deps): bump actions/checkout from 5 to 6 (#126) #393

Workflow file for this run

# This file is generated by ansible
name: Test, build and deploy
on:
push:
env:
PYTHON_VERSION: "3.13"
jobs:
test:
runs-on: [self-hosted, common]
steps:
- uses: actions/checkout@v6
- name: Set up Python
id: setup-python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
env:
POETRY_HOME: ${{ github.workspace }}/.${{ env.PYTHON_VERSION }}-poetry
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: venv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-
- name: Install api
run: poetry install --no-interaction
- name: Run tests
run: >
poetry run pytest
env:
TEST_DB_HOST: postgres
TEST_DB_PORT: 5432
TEST_DB_NAME: platform-back-${{ github.run_id }}
TEST_DB_USER: bimdata
TEST_DB_PASSWORD: bimdata
build-and-push:
runs-on: [self-hosted, common]
needs: [test]
if: contains('
refs/heads/develop
refs/heads/release
refs/heads/master
refs/heads/main'
, github.ref)
steps:
- uses: actions/checkout@v6
- name: Login to BIMData Docker Registry
uses: docker/login-action@v3
with:
registry: docker-registry.bimdata.io
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- id: tag
name: Get docker tag
uses: bimdata/actions/get-docker-tag@v3
with:
branch: ${{ github.ref }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
pull: true
tags: |
docker-registry.bimdata.io/bimdata/platform_back:${{ github.sha }}
docker-registry.bimdata.io/bimdata/platform_back:${{ env.tag }}
deploy:
runs-on: [self-hosted, common]
needs: build-and-push
steps:
- name: Login to BIMData Docker Registry
uses: docker/login-action@v3
with:
registry: docker-registry.bimdata.io
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- id: tag
name: Get docker tag
uses: bimdata/actions/get-docker-tag@v3
with:
branch: ${{ github.ref }}
- name: Deploy on ${{ env.tag }}
uses: bimdata/actions/deployment@v3
with:
inventory: ${{ env.tag }}
app: platform-back
vault-pass: ${{ secrets.ANSIBLE_VAULT_PASSWD }}