-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:mbuchoff/hackathon_backend_23090…
…9 into develop
- Loading branch information
Showing
5 changed files
with
75 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
API_KEY= | ||
CORS_ALLOWED_ORIGINS= | ||
ENV= |
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,30 @@ | ||
name: Azure Webapp deploy | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: azure/docker-login@v1 | ||
with: | ||
# login-server: mycontainer.azurecr.io | ||
username: ${{ secrets.REGISTRY_USERNAME }} | ||
password: ${{ secrets.REGISTRY_PASSWORD }} | ||
- run: | | ||
docker build . -t mbuchoff/hackathon_230909:${{ github.sha }} | ||
docker push mbuchoff/hackathon_230909:${{ github.sha }} | ||
- uses: azure/webapps-deploy@v2 | ||
with: | ||
app-name: 'app-hackathon' | ||
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} | ||
images: 'mbuchoff/hackathon_230909:${{ github.sha }}' |
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
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,37 @@ | ||
#!/usr/bin/env bash | ||
|
||
TARGET='develop' | ||
|
||
cd ~/api || exit | ||
|
||
ACTION_COLOR='\033[1;90m' | ||
NO_COLOR='\033[0m' | ||
|
||
echo -e ${ACTION_COLOR} Checking if we are on the target branch | ||
BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
if [ "$BRANCH" != ${TARGET} ] | ||
then | ||
exit 0 | ||
fi | ||
|
||
# Checking if the repository is up to date. | ||
|
||
git fetch | ||
HEAD_HASH=$(git rev-parse HEAD) | ||
UPSTREAM_HASH=$(git rev-parse ${TARGET}@{upstream}) | ||
|
||
if [ "$HEAD_HASH" == "$UPSTREAM_HASH" ] | ||
then | ||
echo -e "${FINISHED}"The current branch is up to date with origin/${TARGET}."${NO_COLOR}" | ||
exit 0 | ||
fi | ||
|
||
# If there are new changes, we pull these changes. | ||
|
||
git pull origin develop; | ||
|
||
# We can now build and start the containers | ||
|
||
docker compose up -d --build | ||
|
||
exit 0; |