Skip to content

Commit

Permalink
build: update ga workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
cfu288 committed Jun 30, 2024
1 parent 026d79a commit 88a92e3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const { Octokit } = require('@octokit/action');
import { Octokit } from '@octokit/action';

const octokit = new Octokit();

(async () => {
try {
await octokit.request(
`POST /repos/cfu288/ansible_inventories/actions/workflows/${process.env.WORKFLOW_ID}/dispatches`,
{
ref: 'main',
}
},
);
console.log('Stage deploy completed');
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
with:
node-version: 18
- run: npm install @octokit/action
- run: node .github/actions/trigger-stage-deploy.js
- run: node .github/actions/trigger-env-deploy.js
env:
GITHUB_TOKEN: ${{ secrets.PAT_DEPLOY_GITHUB_TOKEN }}
WORKFLOW_ID: ${{ vars.PROD_WORKFLOW_ID }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
with:
node-version: 18
- run: npm install @octokit/action
- run: node .github/actions/trigger-stage-deploy.js
- run: node .github/actions/trigger-env-deploy.js
env:
GITHUB_TOKEN: ${{ secrets.PAT_DEPLOY_GITHUB_TOKEN }}
WORKFLOW_ID: ${{ vars.STAGE_WORKFLOW_ID }}
Expand Down

0 comments on commit 88a92e3

Please sign in to comment.