-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
194 additions
and
68 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,37 @@ | ||
name: Push Workflow | ||
on: push | ||
|
||
jobs: | ||
messenger-demo-deploy: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/${{ vars.STAGING_BRANCH }}' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
registry-url: 'https://npm.pkg.github.com' | ||
node-version: 18.0.0 | ||
cache: 'yarn' | ||
- name: Prepare SSH | ||
run: | | ||
mkdir ~/.ssh | ||
echo "${{ secrets.STAGING_HOST_SSH }}" > ~/.ssh/known_hosts | ||
echo "${{ secrets.DO_SSH_KEY }}" > ./ssh-key | ||
chmod 600 ./ssh-key | ||
- name: Create .env file | ||
run: | | ||
echo "REACT_APP_ADDR_ENS_SUBDOMAIN=.beta-addr.dm3.eth" >> ./.env | ||
echo "REACT_APP_BACKEND=http://${{ secrets.STAGING_HOST }}" >> ./.env | ||
echo "REACT_APP_DEFAULT_DELIVERY_SERVICE=beta-ds.dm3.eth" >> ./.env | ||
echo "REACT_APP_DEFAULT_SERVICE=http://${{ secrets.STAGING_HOST }}" >> ./.env | ||
echo "REACT_APP_ETHEREUM_PROVIDER=${{ secrets.REACT_APP_ETHEREUM_PROVIDER }}" >> ./.env | ||
echo "REACT_APP_PROFILE_BASE_URL=http://dm3-beta2-resolver.herokuapp.com" >> ./.env | ||
echo "REACT_APP_RESOLVER_BACKEND=http://dm3-beta2-resolver.herokuapp.com" >> ./.env | ||
echo "REACT_APP_USER_ENS_SUBDOMAIN=.beta-user.dm3.eth" >> ./.env | ||
echo "REACT_APP_WALLET_CONNECT_PROJECT_ID=${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID }}" >> ./.env | ||
echo "RESOLVER_ADDR=0x45F7Ed7d05c563D408898A80d9C705CC3328D2EF" >> ./.env | ||
echo WEB_PORT=80 >> ./.env | ||
- name: Sync files | ||
run: | | ||
rsync -avz -e 'ssh -i ./ssh-key' ./.env app@${{ secrets.STAGING_HOST }}:/home/app/ | ||
rsync -avz -e 'ssh -i ./ssh-key' ./docker/docker-compose.yml app@${{ secrets.STAGING_HOST }}:/home/app/ |
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ on: push | |
jobs: | ||
code-quality: | ||
runs-on: ubuntu-latest | ||
if: github.ref != 'refs/heads/${{ vars.STAGING_BRANCH }}' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v3 | ||
|
@@ -22,7 +23,7 @@ jobs: | |
|
||
build: | ||
runs-on: ubuntu-latest | ||
|
||
if: github.ref != 'refs/heads/${{ vars.STAGING_BRANCH }}' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v3 | ||
|
@@ -50,6 +51,7 @@ jobs: | |
path: packages/lib/**/schema/ | ||
backend-test: | ||
runs-on: ubuntu-latest | ||
if: github.ref != 'refs/heads/${{ vars.STAGING_BRANCH }}' | ||
needs: build | ||
defaults: | ||
run: | ||
|
@@ -63,6 +65,7 @@ jobs: | |
package-pat: ${{ secrets.PACKAGE_PAT }} | ||
integration-test: | ||
runs-on: ubuntu-latest | ||
if: github.ref != 'refs/heads/${{ vars.STAGING_BRANCH }}' | ||
needs: build | ||
defaults: | ||
run: | ||
|
@@ -76,6 +79,7 @@ jobs: | |
package-pat: ${{ secrets.PACKAGE_PAT }} | ||
lib-crypto-test: | ||
runs-on: ubuntu-latest | ||
if: github.ref != 'refs/heads/${{ vars.STAGING_BRANCH }}' | ||
needs: build | ||
defaults: | ||
run: | ||
|
@@ -89,6 +93,7 @@ jobs: | |
package-pat: ${{ secrets.PACKAGE_PAT }} | ||
lib-delivery-test: | ||
runs-on: ubuntu-latest | ||
if: github.ref != 'refs/heads/${{ vars.STAGING_BRANCH }}' | ||
needs: build | ||
defaults: | ||
run: | ||
|
@@ -102,6 +107,7 @@ jobs: | |
package-pat: ${{ secrets.PACKAGE_PAT }} | ||
lib-messaging-test: | ||
runs-on: ubuntu-latest | ||
if: github.ref != 'refs/heads/${{ vars.STAGING_BRANCH }}' | ||
needs: build | ||
defaults: | ||
run: | ||
|
@@ -115,6 +121,7 @@ jobs: | |
package-pat: ${{ secrets.PACKAGE_PAT }} | ||
lib-profile-test: | ||
runs-on: ubuntu-latest | ||
if: github.ref != 'refs/heads/${{ vars.STAGING_BRANCH }}' | ||
needs: build | ||
defaults: | ||
run: | ||
|
@@ -128,6 +135,7 @@ jobs: | |
package-pat: ${{ secrets.PACKAGE_PAT }} | ||
lib-shared-test: | ||
runs-on: ubuntu-latest | ||
if: github.ref != 'refs/heads/${{ vars.STAGING_BRANCH }}' | ||
needs: build | ||
defaults: | ||
run: | ||
|
@@ -141,6 +149,7 @@ jobs: | |
package-pat: ${{ secrets.PACKAGE_PAT }} | ||
lib-storage-test: | ||
runs-on: ubuntu-latest | ||
if: github.ref != 'refs/heads/${{ vars.STAGING_BRANCH }}' | ||
needs: build | ||
defaults: | ||
run: | ||
|
@@ -154,6 +163,7 @@ jobs: | |
package-pat: ${{ secrets.PACKAGE_PAT }} | ||
offchain-resolver-test: | ||
runs-on: ubuntu-latest | ||
if: github.ref != 'refs/heads/${{ vars.STAGING_BRANCH }}' | ||
needs: build | ||
defaults: | ||
run: | ||
|
@@ -164,53 +174,4 @@ jobs: | |
uses: ./test-action | ||
with: | ||
workspace-name: 'dm3-offchain-resolver' | ||
package-pat: ${{ secrets.PACKAGE_PAT }} | ||
messenger-demo-deploy: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/new-ui' | ||
steps: | ||
# Check-out your repository. | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Create env file | ||
run: | | ||
echo "REACT_APP_ADDR_ENS_SUBDOMAIN=.beta-addr.dm3.eth" >> ./packages/messenger-demo/.env | ||
echo "REACT_APP_BACKEND=https://dm3-beta2.herokuapp.com" >> ./packages/messenger-demo/.env | ||
echo "REACT_APP_DEFAULT_DELIVERY_SERVICE=beta-ds.dm3.eth" >> ./packages/messenger-demo/.env | ||
echo "REACT_APP_DEFAULT_SERVICE=https://dm3-beta2.herokuapp.com" >> ./packages/messenger-demo/.env | ||
echo "REACT_APP_ETHEREUM_PROVIDER=${{ secrets.REACT_APP_ETHEREUM_PROVIDER }}" >> ./packages/messenger-demo/.env | ||
echo "REACT_APP_PROFILE_BASE_URL=https://dm3-beta2-resolver.herokuapp.com" >> ./packages/messenger-demo/.env | ||
echo "REACT_APP_RESOLVER_BACKEND=https://dm3-beta2-resolver.herokuapp.com" >> ./packages/messenger-demo/.env | ||
echo "REACT_APP_USER_ENS_SUBDOMAIN=.beta-user.dm3.eth" >> ./packages/messenger-demo/.env | ||
echo "REACT_APP_WALLET_CONNECT_PROJECT_ID=${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID }}" >> ./packages/messenger-demo/.env | ||
echo "RESOLVER_ADDR=0x45F7Ed7d05c563D408898A80d9C705CC3328D2EF" >> ./packages/messenger-demo/.env | ||
- name: Build, Push and Release a Docker container to Heroku. # Your custom step name | ||
uses: gonuit/[email protected] # GitHub action name (leave it as it is). | ||
with: | ||
# Below you must provide variables for your Heroku app. | ||
|
||
# The email address associated with your Heroku account. | ||
# If you don't want to use repository secrets (which is recommended) you can do: | ||
# email: [email protected] | ||
email: ${{ secrets.HEROKU_EMAIL }} | ||
|
||
# Heroku API key associated with provided user's email. | ||
# Api Key is available under your Heroku account settings. | ||
heroku_api_key: ${{ secrets.HEROKU_API_KEY }} | ||
|
||
# Name of the heroku application to which the build is to be sent. | ||
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }} | ||
|
||
# (Optional, default: "./") | ||
# Dockerfile directory. | ||
# For example, if you have a Dockerfile in the root of your project, leave it as follows: | ||
dockerfile_directory: ./ | ||
|
||
# (Optional, default: "Dockerfile") | ||
# Dockerfile name. | ||
dockerfile_name: ./packages/messenger-demo/Dockerfile | ||
# (Optional, default: "web") | ||
# Select the process type for which you want the docker container to be uploaded. | ||
# By default, this argument is set to "web". | ||
# For more information look at https://devcenter.heroku.com/articles/process-model | ||
process_type: web | ||
package-pat: ${{ secrets.PACKAGE_PAT }} |
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,7 @@ | ||
FROM --platform=linux/amd64 node:18-alpine | ||
WORKDIR /app | ||
COPY . . | ||
RUN apk add --update python3 make g++\ | ||
&& rm -rf /var/cache/apk/* | ||
RUN yarn install | ||
RUN yarn build |
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/sh | ||
docker build --progress=plain -t dm3-backend -f ./docker/Dockerfile . |
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,58 @@ | ||
version: "3.1" | ||
services: | ||
|
||
backend: | ||
image: dm3org/dm3-backend:v0.2.1 | ||
command: yarn workspace dm3-backend start | ||
depends_on: | ||
- db | ||
environment: | ||
- REDIS_URL=redis://db:6379 | ||
|
||
db: | ||
image: redis | ||
restart: always | ||
|
||
offchain-resolver-db: | ||
image: postgres | ||
restart: always | ||
container_name: offchain_resolver_db | ||
environment: | ||
POSTGRES_PASSWORD: example | ||
ports: | ||
- '5432:5432' | ||
|
||
offchain-resolver: | ||
image: dm3org/dm3-backend:v0.2.1 | ||
command: yarn workspace dm3-offchain-resolver start | ||
depends_on: | ||
- offchain-resolver-db | ||
environment: | ||
DATABASE_URL: postgresql://postgres:example@offchain-resolver-db:5432 | ||
ports: | ||
- '8082:8082' | ||
|
||
web: | ||
image: dm3org/dm3-backend:v0.2.1 | ||
command: yarn workspace messenger-demo start | ||
ports: | ||
- '8080:${WEB_PORT}' | ||
|
||
ccip-resolver: | ||
image: dm3org/ccip-resolver:v0.2.2 | ||
restart: always | ||
depends_on: | ||
- offchain-resolver | ||
environment: | ||
SIGNER_PRIVATE_KEY: ${SIGNER_PRIVATE_KEY} | ||
LOG_LEVEL: debug | ||
CONFIG: | | ||
{ | ||
"0x5e0F81D5ca51D309B3A046FAeea70C4C70Df8079": { | ||
"type": "signing", | ||
"handlerUrl": "http://offchain-resolver:8081" | ||
} | ||
} | ||
PORT: 8181 | ||
ports: | ||
- '8181:8181' |
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,8 +1,10 @@ | ||
FROM node:18-alpine | ||
WORKDIR /app | ||
COPY . . | ||
|
||
RUN apk add --update python3 make g++\ | ||
&& rm -rf /var/cache/apk/* | ||
RUN ls | ||
RUN pwd | ||
RUN yarn install | ||
# RUN yarn build | ||
CMD cd packages/backend && yarn start | ||
EXPOSE 3000 | ||
RUN yarn build | ||
CMD yarn workspace messenger-demo start |
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
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
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
Oops, something went wrong.