Skip to content

Deployment Pipeline

Deployment Pipeline #7

Workflow file for this run

name: Deployment Pipeline
on:
workflow_dispatch:
jobs:
get-deployment-params:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get base image
run: |
BASE_VERSION=$(cat ./assets/docker/.BASE_VERSION)
BASE_IMG="${{ env.IMG_ROOT }}-base:$BASE_VERSION-dev"
echo "BASE_IMG=$BASE_IMG" >> $GITHUB_ENV
- name: Extract Gateway container image
# id: extract_gateway_version
run: |
GATEWAY_VERSION=$(python -B .github/parse_container_version.py gateway)
GATEWAY_IMG="${{ env.IMG_ROOT }}-gateway:$GATEWAY_VERSION-dev"
echo "GATEWAY_IMG=$GATEWAY_IMG" >> $GITHUB_ENV
- name: Extract worker container image
run: |
WORKER_VERSION=$(python -B .github/parse_container_version.py worker)
WORKER_IMG="${{ env.IMG_ROOT }}-worker:$WORKER_VERSION-dev"
echo "WORKER_IMG=$WORKER_IMG" >> $GITHUB_ENV
- name: Debug output of extracted images
run: |
echo "IMG_ROOT=${{ env.IMG_ROOT }}"
echo "BASE_IMG=$BASE_IMG"
echo "GATEWAY_IMG=$GATEWAY_IMG"
echo "WORKER_IMG=$WORKER_IMG"
deploy-base:
runs-on: ubuntu-latest
needs: get-deployment-params
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Log in to GHCR
run: echo "${{ secrets.REPO_ADMIN_GHCR_TOKEN }}" | docker login ghcr.io -u "${{ secrets.REPO_ADMIN_GH_USERNAME }}" --password-stdin
- name: Test var persistence
run: |
echo "$BASE_IMG"
# - name: Create gcloud config
# run: |
# echo "$BIOSIMULATIONS_GCLOUD_CONFIG" > ./assets/docker/config/.biosimulations.json
# env:
# BIOSIMULATIONS_GCLOUD_CONFIG: ${{ secrets.BIO_JSON_CONTENT }}
#
# - name: Build base image
# run: |
# docker build --no-cache -f ./Dockerfile -t $BASE_IMG .
#
# - name: Deploy new base version to GHCR
# run: |
# docker push $BASE_IMG
#
# deploy-gateway:
# needs: deploy-base
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v2
#
# - name: Log in to GHCR
# run: echo "${{ secrets.REPO_ADMIN_GHCR_TOKEN }}" | docker login ghcr.io -u "${{ secrets.REPO_ADMIN_GH_USERNAME }}" --password-stdin
#
# - name: Build gateway service
# run: |
# docker build --no-cache -f ./gateway/Dockerfile-gateway -t $GATEWAY_IMG .
#
# - name: Deploy gateway to GHCR with current version
# run: |
# docker push $GATEWAY_IMG
#
# deploy-worker:
# needs: deploy-gateway
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v2
#
# - name: Log in to GHCR
# run: echo "${{ secrets.REPO_ADMIN_GHCR_TOKEN }}" | docker login ghcr.io -u "${{ secrets.REPO_ADMIN_GH_USERNAME }}" --password-stdin
#
# - name: Build worker service
# run: |
# docker build --no-cache -f ./worker/Dockerfile-worker -t $WORKER_IMG .
#
# - name: Deploy worker to GHCR with current version
# run: |
# docker push $WORKER_IMG
#