Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Migrated Jenkins to GHA (UA-8891) #464

Merged
merged 16 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 0 additions & 111 deletions .deployment.config.json

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deployment
on:
push:
branches: [ "master" ]
workflow_dispatch:
inputs:
FORCE_DEPLOY:
type: boolean
description: Force the deploy, even if the last commit is a version bump?
DRY_RUN:
type: boolean
description: Dry run?

jobs:
deploy:
name: Trigger Deployment
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'

- name: Build
run: npm install
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Call coveo.analytics.js-infra
run: node ./scripts/trigger-cd.mjs
env:
GH_TOKEN: ${{ secrets.CD_DISPATCHER }}
FORCE_DEPLOY: ${{ inputs.FORCE_DEPLOY || false }}
DRY_RUN: ${{ inputs.DRY_RUN || github.base_ref == 'master' || false }}

32 changes: 32 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build and Test
on:
pull_request:
branches: [ "master" ]

jobs:
build-and-test:
name: 'Build and Test'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm install
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Build
run: npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Test
run: npm run test
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 0 additions & 3 deletions .terragrunt.hcl

This file was deleted.

Empty file removed .terragrunt.ignore
Empty file.
138 changes: 0 additions & 138 deletions Jenkinsfile

This file was deleted.

13 changes: 0 additions & 13 deletions deploy.sh

This file was deleted.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
"@babel/core": "^7.23.2",
"@babel/preset-env": "7.23.2",
"@babel/register": "^7.22.15",
"@actions/core": "1.10.1",
"@actions/github": "6.0.0",
"@octokit/rest": "20.1.1",
"@rollup/plugin-alias": "^5.0.0",
"@rollup/plugin-commonjs": "^24.1.0",
"@rollup/plugin-json": "^6.0.0",
Expand Down
17 changes: 0 additions & 17 deletions read.version.sh

This file was deleted.

15 changes: 15 additions & 0 deletions scripts/trigger-cd.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {context, getOctokit} from '@actions/github';

const octokit = getOctokit(process.env.GH_TOKEN);

await octokit.rest.repos.createDispatchEvent({
event_type: 'deploy',
client_payload: {
run_Id: context.runId,
FORCE_DEPLOY: process.env.FORCE_DEPLOY,
DRY_RUN: process.env.DRY_RUN
},
owner: 'coveo-platform',
repo: 'coveo.analytics.js-infra',
});

3 changes: 0 additions & 3 deletions terraform/.terragrunt.hcl

This file was deleted.

1 change: 0 additions & 1 deletion terraform/.tgf.config

This file was deleted.

Loading