Skip to content

Docker publish

Docker publish #1

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@v2
- name: Get Version Tag
id: version
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> "$GITHUB_OUTPUT"
- name: Docker Login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: npm
- name: npm build
run: |
export NODE_OPTIONS="--max_old_space_size=4096"
cd frontend
echo "REACT_APP_API_BASE_URL=https://api.syndat.scai.fraunhofer.de" > .env
npm install --legacy-peer-deps
npm ci --loglevel verbose --userconfig npmrc --max-old-space-size=16096 -legacy-peer-deps
npm run build --userconfig npmrc --max-old-space-size=16096
- name: Build & push frontend
uses: docker/build-push-action@v2
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@v2
with:
context: ./api
file: ./api/Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository }}/backend:latest
ghcr.io/${{ github.repository }}/backend:${{ steps.version.outputs.VERSION }}