From 1df20f40fc901578ddda2742a80bf66e19421620 Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Tue, 20 Aug 2024 14:54:13 -0400 Subject: [PATCH 01/21] Create main.yml --- .github/workflows/main.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..b2cc30ebf --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,16 @@ +name: Update App + +on: + push: + branches: [main] + +jobs: + deploy-app: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Deploy the app + uses: digitalocean/app_action/deploy@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} From d5ad680447b1d5cfb76f014f9ce529e0d730f416 Mon Sep 17 00:00:00 2001 From: dbrian57 Date: Tue, 20 Aug 2024 14:58:17 -0400 Subject: [PATCH 02/21] changes color --- public/stylesheets/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index 9453385b9..f14802a4f 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -4,5 +4,5 @@ body { } a { - color: #00B7FF; + color: #02a2e1; } From c793e532eabbb27d904bd3ff7a140f5c6d250563 Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Wed, 21 Aug 2024 12:57:12 -0400 Subject: [PATCH 03/21] Update app.yaml --- .do/app.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.do/app.yaml b/.do/app.yaml index 8f957e1e5..6e6ec6478 100644 --- a/.do/app.yaml +++ b/.do/app.yaml @@ -4,5 +4,5 @@ services: github: branch: main deploy_on_push: true - repo: digitalocean/sample-nodejs + repo: dbrian57/sample-nodejs name: sample-nodejs From 87c66ee8179761c215742a8a65522afac02ce245 Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Fri, 23 Aug 2024 11:16:46 -0400 Subject: [PATCH 04/21] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b2cc30ebf..3f828d85f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ name: Update App on: push: - branches: [main] + branches: [test] jobs: deploy-app: From d280b7a67b8439cb44a7fc2ea507e9d1f4a08659 Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Fri, 23 Aug 2024 11:25:29 -0400 Subject: [PATCH 05/21] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3f828d85f..c883da695 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ name: Update App on: push: - branches: [test] + branches: main jobs: deploy-app: From f4df225c0ea6975f6d530a5c7ab1101ba09cd8ea Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Fri, 23 Aug 2024 11:31:21 -0400 Subject: [PATCH 06/21] Update app.yaml --- .do/app.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.do/app.yaml b/.do/app.yaml index 6e6ec6478..11b399df6 100644 --- a/.do/app.yaml +++ b/.do/app.yaml @@ -4,5 +4,5 @@ services: github: branch: main deploy_on_push: true - repo: dbrian57/sample-nodejs + repo: dbrian57/sample-nodejs-workflow name: sample-nodejs From 1e358eb62133b50ecc374c36132aae3078a5e058 Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Fri, 23 Aug 2024 11:42:38 -0400 Subject: [PATCH 07/21] Update main.yml --- .github/workflows/main.yml | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c883da695..f142ea8fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,16 +1,35 @@ -name: Update App +name: Build, Push and Deploy a Docker Image on: push: - branches: main + branches: [main] jobs: - deploy-app: + build-push-deploy-image: runs-on: ubuntu-latest + permissions: + contents: read + packages: write + id-token: write steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Log in to the Container registry + uses: docker/login-action@v3.3.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.YOUR_GITHUB_TOKEN }} + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v6.5.0 + with: + context: . + push: true + tags: ghcr.io/${{ github.repository }}:latest - name: Deploy the app uses: digitalocean/app_action/deploy@v2 + env: + SAMPLE_DIGEST: ${{ steps.push.outputs.digest }} with: token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} From a172f099741712fce58a19bd6cc994dae2c8853c Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Fri, 23 Aug 2024 11:45:07 -0400 Subject: [PATCH 08/21] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f142ea8fb..71eb0985a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ secrets.YOUR_GITHUB_TOKEN }} + password: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - name: Build and push Docker image id: push uses: docker/build-push-action@v6.5.0 From 780adfdf69e8ed6e9005dca57d0a03271e407778 Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Fri, 23 Aug 2024 11:49:45 -0400 Subject: [PATCH 09/21] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 71eb0985a..fe13fae6b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: uses: docker/login-action@v3.3.0 with: registry: ghcr.io - username: ${{ github.actor }} + username: dbrian57 password: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - name: Build and push Docker image id: push From fc757ea426c37ae3885771f6f7fc3058d32feeac Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Fri, 23 Aug 2024 11:55:26 -0400 Subject: [PATCH 10/21] Update main.yml --- .github/workflows/main.yml | 75 ++++++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe13fae6b..5e037f09e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,35 +1,48 @@ -name: Build, Push and Deploy a Docker Image +name: App Platform Preview on: - push: - branches: [main] + pull_request: + branches: [main] + +permissions: + pull-requests: write jobs: - build-push-deploy-image: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - id-token: write - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Log in to the Container registry - uses: docker/login-action@v3.3.0 - with: - registry: ghcr.io - username: dbrian57 - password: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - name: Build and push Docker image - id: push - uses: docker/build-push-action@v6.5.0 - with: - context: . - push: true - tags: ghcr.io/${{ github.repository }}:latest - - name: Deploy the app - uses: digitalocean/app_action/deploy@v2 - env: - SAMPLE_DIGEST: ${{ steps.push.outputs.digest }} - with: - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + test: + name: preview + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Deploy the app + id: deploy + uses: digitalocean/app_action/deploy@v2 + with: + deploy_pr_preview: "true" + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + - uses: actions/github-script@v7 + env: + BUILD_LOGS: ${{ steps.deploy.outputs.build_logs }} + DEPLOY_LOGS: ${{ steps.deploy.outputs.deploy_logs }} + with: + script: | + const { BUILD_LOGS, DEPLOY_LOGS } = process.env + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: :rocket: :rocket: :rocket: The app was successfully deployed at ${{ fromJson(steps.deploy.outputs.app).live_url }}. [1] + }) + - uses: actions/github-script@v7 + if: failure() + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `The app failed to be deployed. Logs can be found [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}). + ## Logs +
+ Build logs [2] + \`\\ From 97005a7475dc018f7867fa0bb4e27fcba145cc7e Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Fri, 23 Aug 2024 11:56:30 -0400 Subject: [PATCH 11/21] Update style.css --- public/stylesheets/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index f14802a4f..4c27d92e8 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -1,6 +1,6 @@ body { padding: 50px; - font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; + font: 15px "Lucida Grande", Helvetica, Arial, sans-serif; } a { From abf01f193f5b5e123af615840f4fdaf27ef1a674 Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Fri, 23 Aug 2024 12:06:42 -0400 Subject: [PATCH 12/21] Update main.yml --- .github/workflows/main.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5e037f09e..b9f83a95e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,25 +14,28 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Deploy the app id: deploy uses: digitalocean/app_action/deploy@v2 with: deploy_pr_preview: "true" token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + - uses: actions/github-script@v7 env: BUILD_LOGS: ${{ steps.deploy.outputs.build_logs }} DEPLOY_LOGS: ${{ steps.deploy.outputs.deploy_logs }} with: script: | - const { BUILD_LOGS, DEPLOY_LOGS } = process.env + const { BUILD_LOGS, DEPLOY_LOGS } = process.env; github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: :rocket: :rocket: :rocket: The app was successfully deployed at ${{ fromJson(steps.deploy.outputs.app).live_url }}. [1] - }) + body: `🚀🚀🚀 The app was successfully deployed at ${{ steps.deploy.outputs.app.live_url }}.` + }); + - uses: actions/github-script@v7 if: failure() with: @@ -41,8 +44,9 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `The app failed to be deployed. Logs can be found [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}). - ## Logs -
- Build logs [2] - \`\\ + body: `The app failed to be deployed. Logs can be found [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).` + + "\n## Logs\n
\nBuild logs\n\n" + + "```\n${{ env.BUILD_LOGS }}\n```\n\n" + + "Deploy logs\n\n" + + "```\n${{ env.DEPLOY_LOGS }}\n```\n
" + }); From 02b749b3238fdb2c223f0b26d4bec36d26212c06 Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Fri, 23 Aug 2024 12:17:40 -0400 Subject: [PATCH 13/21] Update main.yml --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b9f83a95e..d760921fe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,6 +21,9 @@ jobs: with: deploy_pr_preview: "true" token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Log deploy output + run: echo "${{ steps.deploy.outputs.app }}" - uses: actions/github-script@v7 env: From 1b3e7e4ec52877b12dfe7793fa8dcf98bbd2fa43 Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Fri, 23 Aug 2024 12:22:35 -0400 Subject: [PATCH 14/21] Update main.yml --- .github/workflows/main.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d760921fe..a81ba5c71 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,12 +1,3 @@ -name: App Platform Preview - -on: - pull_request: - branches: [main] - -permissions: - pull-requests: write - jobs: test: name: preview @@ -21,9 +12,9 @@ jobs: with: deploy_pr_preview: "true" token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - + - name: Log deploy output - run: echo "${{ steps.deploy.outputs.app }}" + run: echo "Deploy output: ${{ steps.deploy.outputs.app }}" - uses: actions/github-script@v7 env: @@ -31,12 +22,13 @@ jobs: DEPLOY_LOGS: ${{ steps.deploy.outputs.deploy_logs }} with: script: | - const { BUILD_LOGS, DEPLOY_LOGS } = process.env; + const appOutput = JSON.parse(`{{ steps.deploy.outputs.app }}`); + const liveUrl = appOutput.default_ingress || "URL not found"; github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `🚀🚀🚀 The app was successfully deployed at ${{ steps.deploy.outputs.app.live_url }}.` + body: `🚀🚀🚀 The app was successfully deployed at ${liveUrl}.` }); - uses: actions/github-script@v7 From 058532bb8ead326e86be0fc4e7a1443439f46702 Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Fri, 23 Aug 2024 12:32:57 -0400 Subject: [PATCH 15/21] Update main.yml --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a81ba5c71..7b0fbc655 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,13 +22,13 @@ jobs: DEPLOY_LOGS: ${{ steps.deploy.outputs.deploy_logs }} with: script: | - const appOutput = JSON.parse(`{{ steps.deploy.outputs.app }}`); + const appOutput = JSON.parse('${{ steps.deploy.outputs.app }}'); const liveUrl = appOutput.default_ingress || "URL not found"; github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `🚀🚀🚀 The app was successfully deployed at ${liveUrl}.` + body: "🚀🚀🚀 The app was successfully deployed at " + liveUrl + "." }); - uses: actions/github-script@v7 @@ -39,7 +39,7 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `The app failed to be deployed. Logs can be found [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).` + + body: "The app failed to be deployed. Logs can be found [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})." + "\n## Logs\n
\nBuild logs\n\n" + "```\n${{ env.BUILD_LOGS }}\n```\n\n" + "Deploy logs\n\n" + From 737814e7a238981c95d4b65e3af4203d94546137 Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Fri, 23 Aug 2024 12:56:33 -0400 Subject: [PATCH 16/21] Update main.yml --- .github/workflows/main.yml | 49 +++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7b0fbc655..6f8d2921f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,3 +1,12 @@ +name: App Platform Preview + +on: + pull_request: + branches: [main] + +permissions: + pull-requests: write + jobs: test: name: preview @@ -5,32 +14,25 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Deploy the app id: deploy uses: digitalocean/app_action/deploy@v2 with: deploy_pr_preview: "true" - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - - name: Log deploy output - run: echo "Deploy output: ${{ steps.deploy.outputs.app }}" - + token: ${{ secrets.YOUR_DIGITALOCEAN_ACCESS_TOKEN_VARIABLE_NAME }} - uses: actions/github-script@v7 env: BUILD_LOGS: ${{ steps.deploy.outputs.build_logs }} DEPLOY_LOGS: ${{ steps.deploy.outputs.deploy_logs }} with: script: | - const appOutput = JSON.parse('${{ steps.deploy.outputs.app }}'); - const liveUrl = appOutput.default_ingress || "URL not found"; + const { BUILD_LOGS, DEPLOY_LOGS } = process.env github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: "🚀🚀🚀 The app was successfully deployed at " + liveUrl + "." - }); - + body: `:rocket: :rocket: :rocket: The app was successfully deployed at ${{ appOutput.default_ingress }}. [1]` + }) - uses: actions/github-script@v7 if: failure() with: @@ -39,9 +41,22 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: "The app failed to be deployed. Logs can be found [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})." + - "\n## Logs\n
\nBuild logs\n\n" + - "```\n${{ env.BUILD_LOGS }}\n```\n\n" + - "Deploy logs\n\n" + - "```\n${{ env.DEPLOY_LOGS }}\n```\n
" - }); + body: `The app failed to be deployed. Logs can be found [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}). + + ## Logs +
+ Build logs [2] + + \`\\ + ${BUILD_LOGS} + \`\\ +
+ +
+ Deploy logs [3] + + \`\\ + ${DEPLOY_LOGS} + \`\\ +
` + }) From f20e815999d78a9f23f168f77b4751eb412e6d0c Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Fri, 23 Aug 2024 13:05:47 -0400 Subject: [PATCH 17/21] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6f8d2921f..25d5e8559 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `:rocket: :rocket: :rocket: The app was successfully deployed at ${{ appOutput.default_ingress }}. [1]` + body: `🚀🚀🚀 The app was successfully deployed at ${{ fromJson(steps.deploy.outputs.app).live_url }}. [1]` }) - uses: actions/github-script@v7 if: failure() From 4909774175d788c425495396aabd245a4c4e0362 Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Fri, 23 Aug 2024 13:06:53 -0400 Subject: [PATCH 18/21] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 25d5e8559..18119d3a3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: uses: digitalocean/app_action/deploy@v2 with: deploy_pr_preview: "true" - token: ${{ secrets.YOUR_DIGITALOCEAN_ACCESS_TOKEN_VARIABLE_NAME }} + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - uses: actions/github-script@v7 env: BUILD_LOGS: ${{ steps.deploy.outputs.build_logs }} From e4972d4e2b0ca13893ec43e977cdf2ae1671b77a Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Fri, 23 Aug 2024 13:09:26 -0400 Subject: [PATCH 19/21] Update main.yml --- .github/workflows/main.yml | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 18119d3a3..b9f83a95e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,25 +14,28 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Deploy the app id: deploy uses: digitalocean/app_action/deploy@v2 with: deploy_pr_preview: "true" token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + - uses: actions/github-script@v7 env: BUILD_LOGS: ${{ steps.deploy.outputs.build_logs }} DEPLOY_LOGS: ${{ steps.deploy.outputs.deploy_logs }} with: script: | - const { BUILD_LOGS, DEPLOY_LOGS } = process.env + const { BUILD_LOGS, DEPLOY_LOGS } = process.env; github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `🚀🚀🚀 The app was successfully deployed at ${{ fromJson(steps.deploy.outputs.app).live_url }}. [1]` - }) + body: `🚀🚀🚀 The app was successfully deployed at ${{ steps.deploy.outputs.app.live_url }}.` + }); + - uses: actions/github-script@v7 if: failure() with: @@ -41,22 +44,9 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `The app failed to be deployed. Logs can be found [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}). - - ## Logs -
- Build logs [2] - - \`\\ - ${BUILD_LOGS} - \`\\ -
- -
- Deploy logs [3] - - \`\\ - ${DEPLOY_LOGS} - \`\\ -
` - }) + body: `The app failed to be deployed. Logs can be found [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).` + + "\n## Logs\n
\nBuild logs\n\n" + + "```\n${{ env.BUILD_LOGS }}\n```\n\n" + + "Deploy logs\n\n" + + "```\n${{ env.DEPLOY_LOGS }}\n```\n
" + }); From f442b680a63c2c825cfe659062eec4b371b36aea Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Fri, 23 Aug 2024 13:13:49 -0400 Subject: [PATCH 20/21] Update main.yml --- .github/workflows/main.yml | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b9f83a95e..18119d3a3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,28 +14,25 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Deploy the app id: deploy uses: digitalocean/app_action/deploy@v2 with: deploy_pr_preview: "true" token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - uses: actions/github-script@v7 env: BUILD_LOGS: ${{ steps.deploy.outputs.build_logs }} DEPLOY_LOGS: ${{ steps.deploy.outputs.deploy_logs }} with: script: | - const { BUILD_LOGS, DEPLOY_LOGS } = process.env; + const { BUILD_LOGS, DEPLOY_LOGS } = process.env github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `🚀🚀🚀 The app was successfully deployed at ${{ steps.deploy.outputs.app.live_url }}.` - }); - + body: `🚀🚀🚀 The app was successfully deployed at ${{ fromJson(steps.deploy.outputs.app).live_url }}. [1]` + }) - uses: actions/github-script@v7 if: failure() with: @@ -44,9 +41,22 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `The app failed to be deployed. Logs can be found [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).` + - "\n## Logs\n
\nBuild logs\n\n" + - "```\n${{ env.BUILD_LOGS }}\n```\n\n" + - "Deploy logs\n\n" + - "```\n${{ env.DEPLOY_LOGS }}\n```\n
" - }); + body: `The app failed to be deployed. Logs can be found [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}). + + ## Logs +
+ Build logs [2] + + \`\\ + ${BUILD_LOGS} + \`\\ +
+ +
+ Deploy logs [3] + + \`\\ + ${DEPLOY_LOGS} + \`\\ +
` + }) From 61b1874f2d63ad47607a1b29e447e344923ac6a4 Mon Sep 17 00:00:00 2001 From: Dan Brian Date: Tue, 27 Aug 2024 09:47:11 -0400 Subject: [PATCH 21/21] Delete .do/app.yaml --- .do/app.yaml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .do/app.yaml diff --git a/.do/app.yaml b/.do/app.yaml deleted file mode 100644 index 11b399df6..000000000 --- a/.do/app.yaml +++ /dev/null @@ -1,8 +0,0 @@ -name: sample-nodejs -services: -- environment_slug: node-js - github: - branch: main - deploy_on_push: true - repo: dbrian57/sample-nodejs-workflow - name: sample-nodejs