Skip to content

Adapt to new dgp-auth version #257

Adapt to new dgp-auth version

Adapt to new dgp-auth version #257

Workflow file for this run

name: CI
on:
push:
jobs:
build-server:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- run: |
(cd ui && npm install && npm run build_lib && npm run package)
- env:
DOCKER_IMAGE_NAME: "akariv/dgp-app"
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
if docker pull "${DOCKER_IMAGE_NAME}:latest"; then
CACHE_FROM_ARG="--cache-from ${DOCKER_IMAGE_NAME}:latest"
else
CACHE_FROM_ARG=""
fi &&\
docker build $CACHE_FROM_ARG -t server . &&\
docker tag server "${DOCKER_IMAGE_NAME}:${GITHUB_SHA}" &&\
echo "${DOCKER_PASSWORD}" | docker login -u ${DOCKER_USERNAME} --password-stdin &&\
docker push "${DOCKER_IMAGE_NAME}:${GITHUB_SHA}" &&\
if [ "${GITHUB_REF}" == "refs/heads/master" ]; then
docker tag server "${DOCKER_IMAGE_NAME}:latest" &&\
docker push "${DOCKER_IMAGE_NAME}:latest"
fi
- env:
DOCKER_IMAGE_NAME: "akariv/dgp-app-db"
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "${DOCKER_PASSWORD}" | docker login -u ${DOCKER_USERNAME} --password-stdin &&\
if docker pull "${DOCKER_IMAGE_NAME}:latest"; then
CACHE_FROM_ARG="--cache-from ${DOCKER_IMAGE_NAME}:latest"
else
CACHE_FROM_ARG=""
fi &&\
docker build $CACHE_FROM_ARG -t db db &&\
docker tag server "${DOCKER_IMAGE_NAME}:${GITHUB_SHA}" &&\
docker push "${DOCKER_IMAGE_NAME}:${GITHUB_SHA}" &&\
if [ "${GITHUB_REF}" == "refs/heads/master" ]; then
docker tag db "${DOCKER_IMAGE_NAME}:latest" &&\
docker push "${DOCKER_IMAGE_NAME}:latest"
fi