Skip to content

Commit

Permalink
👷 ci: setup staging environment
Browse files Browse the repository at this point in the history
  • Loading branch information
megasanjay committed Nov 15, 2024
1 parent eca14a2 commit 6a2b4b4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy to staging environment

concurrency:
group: production
group: staging
cancel-in-progress: true

on:
Expand All @@ -24,14 +24,13 @@ jobs:
KAMAL_REGISTRY_PASSWORD: ${{ secrets.KAMAL_REGISTRY_PASSWORD }}
KAMAL_REGISTRY_LOGIN_SERVER: ${{ secrets.KAMAL_REGISTRY_LOGIN_SERVER }}
KAMAL_SERVER_IP: ${{ secrets.KAMAL_SERVER_IP }}
APP_ID: ${{ secrets.APP_ID }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
GH_APP_NAME: ${{ secrets.GH_APP_NAME }}
APP_ID: ${{ secrets.APP_ID }}
GH_APP_ID: ${{ secrets.GH_APP_ID }}
GH_APP_NAME: ${{ secrets.GH_APP_NAME }}
GH_CLIENT_ID: ${{ secrets.GH_CLIENT_ID }}
GH_CLIENT_SECRET: ${{ secrets.GH_CLIENT_SECRET }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
WEBHOOK_PROXY_URL: ${{ secrets.WEBHOOK_PROXY_URL }}
WEBHOOK_SECRET: ${{ secrets.WEBHOOK_SECRET }}
CODEFAIR_APP_DOMAIN: ${{ secrets.CODEFAIR_APP_DOMAIN }}
ZENODO_API_ENDPOINT: ${{ secrets.ZENODO_API_ENDPOINT }}
Expand Down Expand Up @@ -71,4 +70,9 @@ jobs:

# Suggestion to use lock release and redeploy after reading comments from others. Deploying two builds could cause locking issues when the first is cancelled.
- run: kamal lock release --verbose
- run: kamal redeploy --verbose

# Setup kamal for the first time
- run: kamal setup

# Deploy the app for all other times
# - run: kamal redeploy --verbose
3 changes: 2 additions & 1 deletion bot/.kamal/secrets
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
# password manager, ENV, or a file. DO NOT ENTER RAW CREDENTIALS HERE! This file needs to be safe for git.

# Option 1: Read secrets from the environment
# acr credentials
KAMAL_REGISTRY_PASSWORD=$KAMAL_REGISTRY_PASSWORD
KAMAL_REGISTRY_USERNAME=$KAMAL_REGISTRY_USERNAME
KAMAL_REGISTRY_LOGIN_SERVER=$KAMAL_REGISTRY_LOGIN_SERVER

# bot secrets
APP_ID=$APP_ID
DATABASE_URL=$DATABASE_URL
GH_APP_ID=$GH_APP_ID
GH_APP_NAME=$GH_APP_NAME
GH_CLIENT_ID=$GH_CLIENT_ID
GH_CLIENT_SECRET=$GH_CLIENT_SECRET
PRIVATE_KEY=$PRIVATE_KEY
WEBHOOK_PROXY_URL=$WEBHOOK_PROXY_URL
WEBHOOK_SECRET=$WEBHOOK_SECRET
CODEFAIR_APP_DOMAIN=$CODEFAIR_APP_DOMAIN
ZENODO_API_ENDPOINT=$ZENODO_API_ENDPOINT
Expand Down
8 changes: 2 additions & 6 deletions bot/config/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ servers:
# Note: If using Cloudflare, set encryption mode in SSL/TLS setting to "Full" to enable CF-to-app encryption.
proxy:
ssl: true
host: staging2.codefair.io
host: staging-bot.codefair.io
# Proxy connects to your container on port 80 by default.
app_port: 3000

Expand Down Expand Up @@ -50,16 +50,12 @@ env:
- GH_CLIENT_ID
- GH_CLIENT_SECRET
- PRIVATE_KEY
- WEBHOOK_PROXY_URL
- WEBHOOK_SECRET
- CODEFAIR_APP_DOMAIN
- ZENODO_API_ENDPOINT
- ZENODO_ENDPOINT
clear:
NODE_ENV: production
# CODEFAIR_APP_DOMAIN: "https://staging2.codefair.io"
# ZENODO_API_ENDPOINT: "https://sandbox.zenodo.org/api"
# ZENODO_ENDPOINT: "https://sandbox.zenodo.org"

# Aliases are triggered with "bin/kamal <alias>". You can overwrite arguments on invocation:
# "bin/kamal logs -r job" will tail logs from the first server in the job section.
Expand All @@ -70,7 +66,7 @@ env:
# Use a different ssh user than root
#
ssh:
user: azureuser
user: fairdataihub

# Use a persistent storage volume.
#
Expand Down

0 comments on commit 6a2b4b4

Please sign in to comment.