Skip to content

fix: gs API

fix: gs API #80

Workflow file for this run

name: '[docker image]'
on:
push:
branches:
- master
- staging
- rf_rewriteFrontend
# do not rebuild if...
paths-ignore:
# use_docs (use_docs are built on readthedocs any way)
- 'use_docs/*'
jobs:
build-docker-img:
runs-on: ubuntu-latest
env:
DOCKERIMG: voluba
outputs:
VERSION: ${{ steps.setting-vars.outputs.VERSION }}
steps:
- uses: actions/checkout@v4
- name: 'Setup tags'
run: |
if [[ $GITHUB_REF == 'refs/heads/master' ]]; then
echo "DOCKERIMG=voluba:latest" >> "$GITHUB_ENV"
fi
if [[ $GITHUB_REF == 'refs/heads/staging' ]]; then
echo "DOCKERIMG=voluba:staging" >> "$GITHUB_ENV"
fi
if [[ $GITHUB_REF == 'refs/heads/rf_rewriteFrontend' ]]; then
echo "DOCKERIMG=voluba:rf_rewriteFrontend" >> "$GITHUB_ENV"
fi
- name: 'Setup tags'
run: |
if [[ -z "$DOCKERIMG" ]]
then
echo "DOCKERIMG not set!"
exit 1
fi
DOCKER_IMGSTREAM=${{ secrets.EBRAINS_DOCKER_REG_VOLUBA_NSP }}/${DOCKERIMG}
echo "Setting docker image stream to $DOCKER_IMGSTREAM"
echo "DOCKER_IMGSTREAM=$DOCKER_IMGSTREAM" >> $GITHUB_ENV
- name: 'Build docker image'
run: |
echo "Building $DOCKER_IMGSTREAM"
docker build \
-t $DOCKER_IMGSTREAM \
.
echo "Successfully built $DOCKER_IMGSTREAM"
- name: 'Push to docker registry'
run: |
echo "Login to docker registry"
docker login \
-u '${{ secrets.EBRAINS_DOCKER_REG_USER }}' \
-p '${{ secrets.EBRAINS_DOCKER_REG_TOKEN }}' \
docker-registry.ebrains.eu
echo "Pushing $DOCKER_IMGSTREAM"
docker push $DOCKER_IMGSTREAM
- name: 'Tag and push version'
if: ${{ github.ref == 'refs/heads/master' }}
run: |
VERSIONED_DOCKER_IMGSTREAM=${{ secrets.EBRAINS_DOCKER_REG_VOLUBA_NSP }}/${{ env.DOCKERIMG }}:$VERSION
echo "Tagging and pushing $VERSIONED_DOCKER_IMGSTREAM"
docker tag $DOCKER_IMGSTREAM $VERSIONED_DOCKER_IMGSTREAM
docker login \
-u '${{ secrets.EBRAINS_DOCKER_REG_USER }}' \
-p '${{ secrets.EBRAINS_DOCKER_REG_TOKEN }}' \
docker-registry.ebrains.eu
docker push $VERSIONED_DOCKER_IMGSTREAM
deploy-prod-on-rancher:
needs: [ build-docker-img ]
if: ${{ github.ref == 'refs/heads/master' && success() }}
uses: ./.github/workflows/deploy-helm.yml
with:
DEPLOYMENT_NAME: voluba-prod
IMAGE_TAG: ${{ needs.build-docker-img.outputs.VERSION }}
secrets:
KUBECONFIG: ${{ secrets.KUBECONFIG }}
deploy-rc-on-rancher:
needs: [ build-docker-img ]
if: ${{ github.ref == 'refs/heads/staging' && success() }}
uses: ./.github/workflows/deploy-helm.yml
with:
DEPLOYMENT_NAME: voluba-rc
IMAGE_TAG: staging
secrets:
KUBECONFIG: ${{ secrets.KUBECONFIG }}
deploy-rewrite-on-rancher:
needs: [ build-docker-img ]
if: ${{ github.ref == 'refs/heads/rf_rewriteFrontend' && success() }}
uses: ./.github/workflows/deploy-helm.yml
with:
DEPLOYMENT_NAME: voluba-angular
IMAGE_TAG: rf_rewriteFrontend
secrets:
KUBECONFIG: ${{ secrets.KUBECONFIG }}