Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
42aebc2
Creating new github action to build and push docker image
maxsibilla Jan 8, 2026
6b9a37c
Modifying github actions to utilize shell script for docker build
maxsibilla Jan 8, 2026
4aa65c3
Setting working-directory
maxsibilla Jan 8, 2026
1fbc9c6
Updating paths
maxsibilla Jan 8, 2026
059692d
Updating image tag
maxsibilla Jan 8, 2026
f1779ff
Updating image tag
maxsibilla Jan 8, 2026
8f020a6
Adding version variable
maxsibilla Jan 8, 2026
2949294
Adding version variable
maxsibilla Jan 8, 2026
5124d9f
Adding version variable
maxsibilla Jan 8, 2026
84c18b1
Reference variable properly
maxsibilla Jan 8, 2026
faed110
Reference variable properly
maxsibilla Jan 8, 2026
739ba4a
Adding action to deploy docker image on remote server
maxsibilla Jan 8, 2026
522f359
Creating new docker compose file to handle dev repository
maxsibilla Jan 8, 2026
6050b9c
Adding AWS IP whitelist step
maxsibilla Jan 8, 2026
91ab9e4
Adding AWS IP whitelist step
maxsibilla Jan 8, 2026
c5d059e
Modifying when removal of whitelist occurs
maxsibilla Jan 8, 2026
9a96326
Updating ssh action version
maxsibilla Jan 8, 2026
e2a0f9f
Increasing ssh timeout
maxsibilla Jan 8, 2026
b787cb0
Combining all commands into a single line to run as codcc user
maxsibilla Jan 8, 2026
a1cce33
Updating known hosts on remote server
maxsibilla Jan 8, 2026
59d4c3c
Updating known hosts on remote server
maxsibilla Jan 8, 2026
03b92b5
Add use_insecure_cipher property
maxsibilla Jan 8, 2026
15886b0
Making workflow async
maxsibilla Jan 9, 2026
b2b8635
making whitelist step same as deploy
maxsibilla Jan 9, 2026
4116927
Merging whitelist cleanup job into deploy job, adding condition to en…
maxsibilla Jan 9, 2026
7e2fd47
Potential fix for code scanning alert no. 7: Workflow does not contai…
maxsibilla Jan 12, 2026
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
79 changes: 79 additions & 0 deletions .github/workflows/build-and-deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build and Deploy Docker Image on Dev

on:
push:
branches:
- dev-integrate

permissions:
contents: read

jobs:
build-and-push:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Create $ENTITY_API_VERSION
run: |
export ENTITY_API_VERSION=$(tr -d "\n\r" < ../VERSION | xargs)
echo "ENTITY_API_VERSION=$ENTITY_API_VERSION" >> $GITHUB_ENV
working-directory: ./docker

- name: Make build script executable
run: chmod +x ./docker-development.sh
working-directory: ./docker

- name: Run the Docker build shell script
run: ./docker-development.sh build
working-directory: ./docker

- name: Tag the Docker Image
# Alternatively we could use ${{ github.sha }} instead of latest
run: docker image tag sennet/entity-api:$ENTITY_API_VERSION sennet/entity-api-dev:latest
working-directory: ./docker

- name: Push the Docker image
run: docker push sennet/entity-api-dev:latest
working-directory: ./docker

deploy:
runs-on: ubuntu-latest
needs: build-and-push
steps:
- name: Whitelist GitHub Actions IP
uses: bbharathkumarreddy/aws-whitelist-ip@v1.0
with:
security-group-id: sg-0ddfcbe0a83a5266c
action: whitelist
port: 22
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Deploy to Server via SSH
uses: appleboy/ssh-action@v1
with:
host: '${{ secrets.REMOTE_HOST }}'
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
use_insecure_cipher: true
script: |
# Change to codcc user on server
sudo su - codcc -c "cd /opt/sennet/entity-api/docker/; git pull; docker pull sennet/entity-api-dev:latest; ./docker-development.sh down; ./docker-development.sh start;"
- name: Remove GitHub Actions IP
uses: bbharathkumarreddy/aws-whitelist-ip@v1.0
if: always()
with:
security-group-id: sg-0ddfcbe0a83a5266c
action: remove
port: 22
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
4 changes: 4 additions & 0 deletions docker/docker-compose.deployment.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
services:
entity-api:
# Use the published image and tag from DockerHub
image: sennet/entity-api-dev:latest
2 changes: 1 addition & 1 deletion docker/docker-development.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ else

docker compose -f docker-compose.yml -f docker-compose.development.yml -p entity-api build
elif [ "$1" = "start" ]; then
docker compose -f docker-compose.yml -f docker-compose.development.yml -p entity-api up -d
docker compose -f docker-compose.yml -f docker-compose.deployment.dev.yml -p entity-api up -d
elif [ "$1" = "stop" ]; then
docker compose -f docker-compose.yml -f docker-compose.development.yml -p entity-api stop
elif [ "$1" = "down" ]; then
Expand Down