Skip to content

Commit

Permalink
ci: add actions in github
Browse files Browse the repository at this point in the history
  • Loading branch information
thisyahlen-deriv committed Mar 26, 2024
1 parent 7533611 commit 01093e4
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
13 changes: 13 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Build
description: Build dist
inputs:
target:
description: 'Target Environment'
required: true
default: staging
runs:
using: composite
steps:
- name: Building dist for ${{ inputs.target }}
run: node_modules/grunt/bin/grunt releaseci --${{ inputs.target }}
shell: bash
21 changes: 21 additions & 0 deletions .github/actions/npm_install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: npm_install
description: Install npm packages
runs:
using: composite
steps:
- name: restore_cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
key: node-{{ checksum "package-lock.json" }}
path: UPDATE_ME
restore-keys: |-
node-{{ checksum "package-lock.json" }}
node-
- name: Install npm packages
run: npm ci
shell: bash
- name: save_cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: node_modules
key: node-{{ checksum "package-lock.json" }}
12 changes: 6 additions & 6 deletions .github/workflows/build-and-deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
checks: write
pull-requests: write
steps:
# - name: Verify user
# uses: "deriv-com/shared-actions/.github/actions/verify_user_in_organization@v1"
# with:
# username: ${{github.event.pull_request.user.login}}
# token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Verify user
uses: "deriv-com/shared-actions/.github/actions/verify_user_in_organization@v1"
with:
username: ${{github.event.pull_request.user.login}}
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

- name: Post preview build comment
id: post_preview_build_comment
Expand All @@ -44,7 +44,7 @@ jobs:
node-version: 20.x

- name: Install dependencies
uses: "./.github/actions/npm_install_from_cache"
uses: "./.github/actions/npm_install"

- name: Build
uses: "./.github/actions/build"
Expand Down

0 comments on commit 01093e4

Please sign in to comment.