Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch 'dev' to 'stage' #745

Merged
merged 1 commit into from
Dec 31, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
type: choice
options:
- production
- development
- staging

env:
registry: ghcr.io/${{ github.repository_owner }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-and-push-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
type: choice
options:
- production
- development
- staging

env:
registry: ghcr.io/${{ github.repository_owner }}
Expand All @@ -37,6 +37,7 @@ jobs:
working-directory: ${{ env.project_root }}
run: |
sed -i 's|${API_BASE_URL}|${{ vars.API_BASE_URL }}|g' wwwroot/appsettings.json
sed -i 's|${API_BASE_URL}|${{ vars.API_BASE_URL }}|g' wwwroot/appsettings.Development.json

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-to-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ on:
type: choice
options:
- production
- development
- staging

env:
docker_compose_profile: ${{ (github.event.inputs.environment == 'development' && 'local') || 'web' }}
docker_compose_profile: ${{ (github.event.inputs.environment == 'staging' && 'local') || 'web' }}

jobs:
deploy-web-container:
Expand Down Expand Up @@ -68,8 +68,8 @@ jobs:
source: docker-compose.yml
target: crypter-web-container/

- name: Push latest Docker Compose override file if deploying to Development server
if: github.event.inputs.environment == 'development'
- name: Push latest Docker Compose override file if deploying to Staging server
if: github.event.inputs.environment == 'staging'
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.APPSERVER_SSH_HOST }}
Expand Down
11 changes: 11 additions & 0 deletions Crypter.Web/wwwroot/appsettings.Staging.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"ApiSettings": {
"ApiBaseUrl": "${API_BASE_URL}"
},
"Logging": {
"LogLevel": {
"Default": "Debug",
"Microsoft.AspNetCore": "Information"
}
}
}
10 changes: 7 additions & 3 deletions Crypter.Web/wwwroot/js/blazorStartup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
const environmentMap = {
"localhost": "Development",
"stage.crypter.dev": "Staging",
"www.crypter.dev": "Production"
}

Blazor.start({
environment: window.location.hostname === "localhost"
? "Development"
: "Production"
environment: environmentMap[window.location.hostname]
});
Loading