-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update build, publish, deploy system [DEV-1805] (#38)
* fix(no-release): DID provider init logic * fix(deps): Move devDependencies out of dependencies block * fix: Run with miniflare * add: GitHub Action for DO Apps deployment * fix(deps): Version bump * fix: NPM config * refactor: Use auth0 service endpoint from secrets * fix: Staging Deployment on DO Apps * chore: Add README * fix(deps): Version bump dependencies - @semantic-release/github 8.0.6 - ts-loader 9.3.1 - prettier 2.7.1 - terser-webpack-plugin - semantic-release 19.0.5 * Update .dockerignore * Remove redundant Docker image metadata * Changed build image names and labels * Rename staging image * fix: Updated Dockerfile to use default node user * Turn verbose mode off in linter * Update gitignore and remove agent.yml * Add a start command for NPM * Remove custom shell entrypoint in Dockerfile Removed the custom entrypoint script call in Dockerfile, since most of this can be handled as build/run time variables * Remove line breaks * Change port to Miniflare default * Delete default agent.yml config * Delete scripts folder * Delete docker-compose.yml * refactor: Constants and Dockerfile * fix: Dockerfile ENV definition * fix: Labels for docker image * Update Dockerfile * Update build.yml * Change commitlint file * Remove variables from Wrangler * Update Dockerfile * Set build stage target * Update Dockerfile * Update Dockerfile * Add curl and log errors * wip --skip-ci * Create dependabot.yml * Add release guard * Add staging URL * Fix package lock * Update Dockerfile Signed-off-by: jay-dee7 <[email protected]> Co-authored-by: Ankur Banerjee <[email protected]>
- Loading branch information
Showing
29 changed files
with
9,397 additions
and
13,277 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 |
---|---|---|
@@ -1 +1,9 @@ | ||
node_modules/ | ||
# Skip unncecessary folders | ||
dist/** | ||
node_modules/** | ||
.github/** | ||
|
||
# Skip unnecessary files | ||
**/*.md | ||
Dockerfile** | ||
docker-compose.yml |
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,42 @@ | ||
################################# | ||
# GitHub Dependabot Config info # | ||
################################# | ||
|
||
version: 2 | ||
updates: | ||
|
||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
|
||
# Maintain dependencies for NPM | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
|
||
# Maintain dependencies for Docker | ||
- package-ecosystem: "docker" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
|
||
# Maintain dependencies for Golang | ||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
|
||
# Maintain dependencies for Terraform | ||
- package-ecosystem: "terraform" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
|
||
# Maintain dependencies for Python | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
File renamed without changes.
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 |
---|---|---|
|
@@ -6,85 +6,32 @@ defaults: | |
shell: bash | ||
|
||
jobs: | ||
staging-deploy: | ||
name: "Cloudflare - Staging" | ||
deploy-staging: | ||
name: "Staging Deploy" | ||
runs-on: ubuntu-latest | ||
environment: | ||
continue-on-error: true | ||
env: | ||
IMAGE_NAME: registry.digitalocean.com/${{ github.repository }} | ||
environment: | ||
name: staging | ||
url: https://credential-service-staging.cheqd.io/ | ||
url: https://credential-service-staging.cheqd.net | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
- name: Install DigitalOcean CLI | ||
uses: digitalocean/action-doctl@v2 | ||
with: | ||
node-version: '16.x' | ||
# cache: 'npm' <--- Commenting out, see: https://github.com/bahmutov/npm-install/issues/80, as of 13th of June 2022. | ||
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | ||
|
||
- name: Publish to Cloudflare | ||
uses: cloudflare/[email protected] | ||
with: | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
environment: staging | ||
secrets: | | ||
_ISSUER_ID | ||
_ISSUER_ID_PRIVATE_KEY_HEX | ||
_ISSUER_ID_PUBLIC_KEY_HEX | ||
_ISSUER_ID_KID | ||
_ISSUER_ID_METHOD_SPECIFIC_ID | ||
_ISSUER_ID_METHOD | ||
wranglerVersion: '2.0.7' | ||
preCommands: npm install | ||
command: publish --env staging | ||
env: | ||
NPM_GITHUB_PAT: ${{ secrets.NPM_GITHUB_PAT }} | ||
_ISSUER_ID: ${{ secrets._ISSUER_ID }} | ||
_ISSUER_ID_PRIVATE_KEY_HEX: ${{ secrets._ISSUER_ID_PRIVATE_KEY_HEX }} | ||
_ISSUER_ID_PUBLIC_KEY_HEX: ${{ secrets._ISSUER_ID_PUBLIC_KEY_HEX }} | ||
_ISSUER_ID_KID: ${{ secrets._ISSUER_ID_KID }} | ||
_ISSUER_ID_METHOD_SPECIFIC_ID: ${{ secrets._ISSUER_ID_METHOD_SPECIFIC_ID }} | ||
_ISSUER_ID_METHOD: ${{ secrets._ISSUER_ID_METHOD }} | ||
|
||
production-deploy: | ||
name: "Cloudflare - Production" | ||
needs: staging-deploy | ||
if: ${{ success() && ( github.ref_name == 'main' ) }} | ||
runs-on: ubuntu-latest | ||
# permissions: | ||
# security-events: write | ||
environment: | ||
name: production | ||
url: https://credential-service.cheqd.io/ | ||
- name: Login to DOCR | ||
run: doctl registry login --expiry-seconds 600 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
- name: Download docker image | ||
uses: actions/download-artifact@v3 | ||
with: | ||
node-version: '16.x' | ||
# cache: 'npm' <--- Commenting out, see: https://github.com/bahmutov/npm-install/issues/80, as of 13th of June 2022. | ||
name: credential-service-staging | ||
|
||
- name: Publish to Cloudflare | ||
uses: cloudflare/[email protected] | ||
with: | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
secrets: | | ||
_ISSUER_ID | ||
_ISSUER_ID_PRIVATE_KEY_HEX | ||
_ISSUER_ID_PUBLIC_KEY_HEX | ||
_ISSUER_ID_KID | ||
_ISSUER_ID_METHOD_SPECIFIC_ID | ||
_ISSUER_ID_METHOD | ||
wranglerVersion: '2.0.7' | ||
preCommands: npm install | ||
command: publish | ||
env: | ||
NPM_GITHUB_PAT: ${{ secrets.NPM_GITHUB_PAT }} | ||
_ISSUER_ID: ${{ secrets._ISSUER_ID }} | ||
_ISSUER_ID_PRIVATE_KEY_HEX: ${{ secrets._ISSUER_ID_PRIVATE_KEY_HEX }} | ||
_ISSUER_ID_PUBLIC_KEY_HEX: ${{ secrets._ISSUER_ID_PUBLIC_KEY_HEX }} | ||
_ISSUER_ID_KID: ${{ secrets._ISSUER_ID_KID }} | ||
_ISSUER_ID_METHOD_SPECIFIC_ID: ${{ secrets._ISSUER_ID_METHOD_SPECIFIC_ID }} | ||
_ISSUER_ID_METHOD: ${{ secrets._ISSUER_ID_METHOD }} | ||
- name: Load Docker image | ||
run: docker image load --input credential-service-staging.tar | ||
|
||
- name: Push images to DOCR | ||
run: docker image push --all-tags ${{ env.IMAGE_NAME }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
@cheqd:registry=https://npm.pkg.github.com | ||
//npm.pkg.github.com/:_authToken=${NPM_GITHUB_PAT} | ||
@cheqd:registry=https://registry.npmjs.org/ | ||
access=public |
Oops, something went wrong.