-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stage workflow and dev workflow name change
- Loading branch information
1 parent
1bfc447
commit 552fe05
Showing
2 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
.github/workflows/est-frontend-dev.yml → .github/workflows/est-workflow-dev.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Deploy Frontend | ||
name: Deploy EST Frontend and Backend to development | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Deploy EST Frontend and Backend to Staging | ||
|
||
on: | ||
push: | ||
branches: | ||
- stage | ||
|
||
jobs: | ||
deploy: | ||
runs-on: [self-hosted, stage] | ||
|
||
steps: | ||
- name: Set permissions for workspace directory | ||
run: | | ||
sudo chown -R ubuntu:ubuntu /home/ubuntu/actions-runner/_work/classifier/classifier | ||
sudo chmod -R u+rwx /home/ubuntu/actions-runner/_work/classifier/classifier | ||
- name: Clean up workspace | ||
run: | | ||
sudo rm -rf /home/ubuntu/actions-runner/_work/classifier/classifier/* | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
clean: true | ||
|
||
- name: Remove all running containers, images, and prune Docker system | ||
run: | | ||
docker stop $(docker ps -a -q) || true | ||
docker rm $(docker ps -a -q) || true | ||
images_to_keep="authentication-layer|tim|data-mapper|resql|ruuter" | ||
docker images --format "{{.Repository}}:{{.Tag}}" | grep -Ev "$images_to_keep" | xargs -r docker rmi || true | ||
docker volume prune -f | ||
docker network prune -f | ||
- name: Build and run Docker Compose | ||
run: | | ||
docker compose up --build -d | ||
- name: Get public IP address | ||
id: get_ip | ||
run: | | ||
PUBLIC_IP=$(curl -s http://checkip.amazonaws.com) | ||
echo "PUBLIC_IP=$PUBLIC_IP" >> $GITHUB_ENV | ||
- name: Send Slack notification | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
PUBLIC_IP: ${{ env.PUBLIC_IP }} | ||
run: | | ||
curl -X POST -H 'Content-type: application/json' --data "{ | ||
\"text\": \"Build is complete. Public IP: $PUBLIC_IP\" | ||
}" $SLACK_WEBHOOK_URL |