Skip to content

Remove env settings #8

Remove env settings

Remove env settings #8

name: Build and Push Docker Image
on:
push:
tags:
- 'v*'
jobs:
build-and-push:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Validate Tag Format
id: validate_tag
run: |
if [[ ! "${GITHUB_REF_NAME}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Invalid tag format: ${GITHUB_REF_NAME}"
exit 1
fi
env:
GITHUB_REF_NAME: ${{ github.ref_name }}
- name: Log in to GitHub Container Registry
uses: docker/#-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker Image with docker compose
run: |
docker compose -f docker/compose.ci.yaml \
build --build-arg PLATFORM=prod
shell: bash
- name: Push Docker Image to Registry
run: |
IMAGE_NAME="ghcr.io/modernism-in-architecture/mia-django"
docker tag mia-django ${IMAGE_NAME}:${{ github.ref_name }}
docker tag mia-django ${IMAGE_NAME}:latest
docker push ${IMAGE_NAME}:${{ github.ref_name }}
docker push ${IMAGE_NAME}:latest
shell: bash