Skip to content

Commit

Permalink
Healthcheck cleanup (#1160)
Browse files Browse the repository at this point in the history
* feat: cleanup

* feat: cleanup and deploy
  • Loading branch information
bojanrajh authored Oct 27, 2023
1 parent 11aa24a commit bb08d63
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 6 deletions.
1 change: 0 additions & 1 deletion .github/scripts/create-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ async function createCheck() {
try {
const createCheckResponse = await octokit.checks.create({
owner: process.env.GITHUB_REPOSITORY_OWNER,
//repo: process.env.GITHUB_REPOSITORY,
repo: 'docs',
name: 'DevHub',
head_sha: process.env.GITHUB_SHA,
Expand Down
6 changes: 4 additions & 2 deletions .github/scripts/trigger-workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ async function triggerWorkflow() {
owner: 'shopware',
repo: 'developer-portal',
ref: `main`,
workflow_id: 'external-healthcheck.yml',
inputs: {
workflow_id: process.env.WORKFLOW,
inputs: process.env.WORKFLOW === 'checkout-test-build-deploy.yml'
? {}
: {
branch: process.env.DEV_HUB_BRANCH,
repo: process.env.DEV_HUB_REPO,
sha: process.env.DEV_HUB_SHA,
Expand Down
2 changes: 0 additions & 2 deletions .github/scripts/update-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ const { Octokit } = require('@octokit/rest');

const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN,
//auth: process.env.PERSONAL_ACCESS_TOKEN,
//auth: process.env.ADDITIONAL_ACCESS_TOKEN,
});

async function createCheck() {
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/deploy-developer-portal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy to DevHub

on:
push:
branches:
- main

jobs:
trigger-deployment:
name: Trigger deployment
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Install dependencies
run: |
npm i @octokit/rest
- name: Trigger deployment
run: |
node .github/scripts/trigger-workflow.js
env:
WORKFLOW: "checkout-test-build-deploy.yml"
PERSONAL_ACCESS_TOKEN: ${{ secrets.DEV_HUB_PERSONAL_ACCESS_TOKEN }}
DEV_HUB_BRANCH: ${{ inputs.branch }}
DEV_HUB_REPO: ${{ inputs.repo }}
DEV_HUB_SHA: ${{ inputs.sha }}
DEV_HUB_CHECK: ${{ inputs.check }}
DEV_HUB_CONCLUSION: ${{ steps.status.outputs.success == 'true' && 'success' || 'failure' }}
3 changes: 2 additions & 1 deletion .github/workflows/developer-portal-healthckeck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ jobs:
PERSONAL_ACCESS_TOKEN: ${{ secrets.DEV_HUB_PERSONAL_ACCESS_TOKEN }}
DEV_HUB_BRANCH: ${{ github.ref_name }}
DEV_HUB_REPO: ${{ github.repository }}
DEV_HUB_SHA: ${{ github.sha }}
DEV_HUB_SHA: ${{ github.sha }}
WORKFLOW: "external-healthcheck.yml"

0 comments on commit bb08d63

Please sign in to comment.