Skip to content

Docker publish

Docker publish #9

Workflow file for this run

name: Docker publish
on:
release:
types: [published]
jobs:
build_docker_image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Version Tag
id: version
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> "$GITHUB_OUTPUT"
- name: Docker Login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: Build frontend (Vite)
run: |
cd frontend
echo "REACT_APP_API_BASE_URL=https://api.syndat.scai.fraunhofer.de" > .env
npm ci
npm run build
- name: Build & push frontend
uses: docker/build-push-action@v5
with:
context: ./frontend
file: ./frontend/Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository }}/frontend:latest
ghcr.io/${{ github.repository }}/frontend:${{ steps.version.outputs.VERSION }}
- name: Build & push api
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository }}/backend:latest
ghcr.io/${{ github.repository }}/backend:${{ steps.version.outputs.VERSION }}