-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#1) adding the docker-hub deployment ci
- Loading branch information
1 parent
80d8fd9
commit d14eb98
Showing
7 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
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
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,57 @@ | ||
name: Deploy to Cloud | ||
|
||
on: | ||
push: | ||
branches: | ||
- project_setup | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
# - name: Set up SSH | ||
# run: | | ||
# mkdir -p ~/.ssh/ | ||
# echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa | ||
# chmod 600 ~/.ssh/id_rsa | ||
# ssh-keyscan -H ${{ secrets.DROPLET_IP }} >> ~/.ssh/known_hosts | ||
# cat ~/.ssh/known_hosts # Add this line to confirm that the key is added | ||
|
||
- name: Check the structure | ||
run: | | ||
pwd | ||
ls -la | ||
- name: Docker Login | ||
run: | | ||
echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | ||
- name: Run dockerize_all.sh | ||
run: | | ||
chmod +x ./MiniSpace/scripts/dockerize-all.sh | ||
./SwiftParcel/scripts/dockerize-all.sh | ||
- name: Check the structure 2 | ||
run: | | ||
pwd | ||
ls -la | ||
# - name: Test SSH Connection | ||
# run: | | ||
# ssh -vvv root@${{ secrets.DROPLET_IP }} "echo SSH Connection Successful" | ||
|
||
# - name: Stop and Remove Containers | ||
# run: | | ||
# ssh root@${{ secrets.DROPLET_IP }} "docker ps -q --filter network=swiftparcel-network | xargs -r docker stop && docker ps -a -q --filter network=swiftparcel-network | xargs -r docker rm" | ||
|
||
# - name: Clean up existing Cloud networks | ||
# run: | | ||
# ssh root@${{ secrets.DROPLET_IP }} "docker network rm swiftparcel-network || true" | ||
|
||
# - name: Deploy to Cloud | ||
# run: | | ||
# scp -r ./SwiftParcel/d-docker-compose root@${{ secrets.DROPLET_IP }}:${{ secrets.CLOUD_PROJECT_PATH }} | ||
# ssh root@${{ secrets.DROPLET_IP }} "cd ${{ secrets.CLOUD_PROJECT_PATH }}/SwiftParcel/d-docker-compose && docker-compose -f ${{ secrets.CLOUD_DEPLOYMENT_FILE }} pull && docker-compose -f ${{ secrets.CLOUD_DEPLOYMENT_FILE }} up -d --force-recreate" |
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,2 @@ | ||
#!/bin/bash | ||
dotnet build -c release |
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,11 @@ | ||
#!/bin/bash | ||
|
||
export ASPNETCORE_ENVIRONMENT=Development | ||
|
||
cd MiniSpace.APIGateway | ||
|
||
docker build -t minispace.web:latest . | ||
|
||
docker tag minispace.web:latest adrianvsaint/minispace.web:latest | ||
|
||
docker push adrianvsaint/minispace.web:latest |
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,21 @@ | ||
#!/bin/bash | ||
TAG='' | ||
VERSION_TAG= | ||
|
||
case "$TRAVIS_BRANCH" in | ||
"master") | ||
TAG=latest | ||
VERSION_TAG=$TRAVIS_BUILD_NUMBER | ||
;; | ||
"develop") | ||
TAG=dev | ||
VERSION_TAG=$TAG-$TRAVIS_BUILD_NUMBER | ||
;; | ||
esac | ||
|
||
REPOSITORY=$DOCKER_USERNAME/pacco.services.identity | ||
|
||
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD | ||
docker build -t $REPOSITORY:$TAG -t $REPOSITORY:$VERSION_TAG . | ||
docker push $REPOSITORY:$TAG | ||
docker push $REPOSITORY:$VERSION_TAG |
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,4 @@ | ||
#!/bin/bash | ||
export ASPNETCORE_ENVIRONMENT=local | ||
cd src/MiniSpace.Services.Identity.Api | ||
dotnet run |
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,2 @@ | ||
#!/bin/bash | ||
dotnet test |