Skip to content

Install packages, actions updates #2

Install packages, actions updates

Install packages, actions updates #2

Workflow file for this run

name: Build web backend
on:
push:
branches:
- main
paths:
- 'web-backend/**'
- '.github/workflows/web-backend.yml'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'poetry'
- name: Install dependencies
run: |
cd web-backend
poetry install
- name: Run tests
run: |
cd web-backend
poetry run ruff check
build:
needs: test
if: github.ref == 'refs/heads/main'
env:
IMAGE: ghcr.io/openinframap/web-backend
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
context: ./web-backend
file: ./web-backend/Dockerfile
push: true
tags: |
${{ env.IMAGE }}:${{ github.sha }}-${{ github.run_number }}