Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
GITHUB_SHA_SHORT=$(echo ${{ github.sha }} | cut -c1-7)
echo "GITHUB_SHA_SHORT=${GITHUB_SHA_SHORT}" >> $GITHUB_ENV
echo "::set-output name=GITHUB_SHA_SHORT::${GITHUB_SHA_SHORT}"
- name: Set lowercase image name
run: echo "IMAGE_NAME_LOWER=$(echo '${{ env.IMAGE_NAME }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Build image
run: docker compose -f deployment/docker-compose.ci.yml build
- name: Docker login
Expand All @@ -49,6 +51,8 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set lowercase image name
run: echo "IMAGE_NAME_LOWER=$(echo '${{ env.IMAGE_NAME }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
Expand Down Expand Up @@ -139,6 +143,6 @@ jobs:
# TODO: It would be better to use docker-compose against the django service,
# but there is currently a bug in docker-compose preventing running services
# over an SSH host.
IMAGE=${REGISTRY}/${IMAGE_NAME}/django:${GITHUB_SHA_SHORT}
IMAGE=${REGISTRY}/${IMAGE_NAME_LOWER}/django:${GITHUB_SHA_SHORT}
docker run --rm --env-file .env ${IMAGE} python manage.py migrate
echo "Deployment complete"
4 changes: 1 addition & 3 deletions deployment/docker-compose.ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
version: "3.8"

services:
django:
build:
context: ..
dockerfile: ./deployment/Dockerfile
image: ${REGISTRY}/${IMAGE_NAME}/django:${GITHUB_SHA_SHORT}
image: ${REGISTRY}/${IMAGE_NAME_LOWER}/django:${GITHUB_SHA_SHORT}
4 changes: 1 addition & 3 deletions deployment/docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
version: "3.8"

services:
django:
image: ${REGISTRY}/${IMAGE_NAME}/django:${GITHUB_SHA_SHORT}
image: ${REGISTRY}/${IMAGE_NAME_LOWER}/django:${GITHUB_SHA_SHORT}
command: gunicorn hackathon_site.wsgi:application --bind 0.0.0.0:8000 --workers 5 --capture-output --access-logfile - --error-logfile -
ports:
- "8000:8000"
Expand Down
Loading