Skip to content

add depths to export #4

add depths to export

add depths to export #4

name: Create and publish an image
on:
push:
branches:
- "release-**"
- "automated_tests"
env:
IMAGE_NAME: obs-roundabout
jobs:
# RDB Automated Build and Tagging
setup-build-publish:
name: RDB Setup, Build, and Publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build, Tag & Push Production Image
if: contains(github.ref, 'release')
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
IMAGE_ID=ghcr.io/${{ github.repository }}
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from branch
BRANCH=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "release-" prefix from version
VERSION=$(echo $BRANCH | sed -e 's/.*-//')
echo "IMAGE_ID:"
echo $IMAGE_ID
echo "VERSION:"
echo $VERSION
# Build Production Django Container
docker build -f compose/production/django/Dockerfile -t $IMAGE_ID .
docker image ls
docker tag $IMAGE_ID $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION