Skip to content

added stuff

added stuff #29

name: Docker
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Docker Login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
- name: Get Version Tags
id: versions
run: |
echo "FRONTEND_VERSION=$(node -p "require('./frontend/variable-mapper/package.json').version")" >> "$GITHUB_OUTPUT"
echo "BACKEND_VERSION=$(echo "$(<backend/main.py)" | grep -oP "(?<=version=\")[^\"]+")" >> "$GITHUB_OUTPUT"
- name: Build & push frontend
uses: docker/build-push-action@v5
with:
push: true
context: ./frontend
file: ./frontend/Dockerfile
tags: ghcr.io/scai-bio/ad-mapper/frontend:latest, ghcr.io/scai-bio/ad-mapper/frontend:${{ steps.versions.outputs.FRONTEND_VERSION }}
- name: Build & push backend
uses: docker/build-push-action@v2
with:
push: true
context: ./backend
file: ./backend/Dockerfile
tags: ghcr.io/scai-bio/ad-mapper/backend:latest, ghcr.io/scai-bio/ad-mapper/backend:${{ steps.versions.outputs.BACKEND_VERSION }}