Skip to content

Commit

Permalink
(chore) Fix errors in workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen authored Mar 4, 2024
1 parent 2352f6c commit a78d446
Showing 1 changed file with 17 additions and 23 deletions.
40 changes: 17 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: OpenMRS CI

env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_TOKEN: ${{ secrets.TURBO_SERVER_TOKEN }}
TURBO_TEAM: ${{ github.repository_owner }}

on:
push:
branches: [main]
Expand All @@ -10,33 +15,28 @@ on:
- created

jobs:

build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_TOKEN: ${{ secrets.TURBO_SERVER_TOKEN }}
TURBO_TEAM: ${{ github.repository_owner }}

steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16"

- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile

- name: Setup a local cache server for Turborepo
uses: felixmosh/turborepo-gh-artifacts@v2
with:
Expand All @@ -45,10 +45,10 @@ jobs:

- name: Run lint, typecheck and tests
run: yarn verify

- name: Run build
run: yarn turbo run build --color --concurrency=5

- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
Expand All @@ -58,9 +58,7 @@ jobs:
pre_release:
runs-on: ubuntu-latest

needs: build

if: ${{ github.event_name == 'push' }}

steps:
Expand All @@ -70,7 +68,7 @@ jobs:
with:
node-version: "16"
registry-url: "https://registry.npmjs.org"

- name: Cache dependencies
id: cache
uses: actions/cache@v3
Expand All @@ -81,22 +79,20 @@ jobs:
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --immutable

- run: yarn lerna version "$(node -e "console.log(require('semver').inc(require('./lerna.json').version, 'patch'))")-pre.${{ github.run_number }}" --no-git-tag-version --no-push --yes
- run: yarn turbo run build --color --concurrency=5
- run: git config user.email "[email protected]" && git config user.name "OpenMRS CI"
- run: git add . && git commit -m "Prerelease version" --no-verify

- name: Pre-release
run: yarn run ci:prepublish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

release:
runs-on: ubuntu-latest

needs: build

if: ${{ github.event_name == 'release' }}

steps:
Expand All @@ -106,7 +102,7 @@ jobs:
with:
node-version: "16"
registry-url: "https://registry.npmjs.org"

- name: Cache dependencies
id: cache
uses: actions/cache@v3
Expand All @@ -120,23 +116,21 @@ jobs:

- name: Build
run: yarn turbo run build --color --concurrency=5

- name: Publish
run: yarn run ci:publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

deploy_admin_tools:
runs-on: ubuntu-latest

needs: pre_release

if: ${{ github.event_name == 'push' }}

steps:
- name: Trigger RefApp Build
uses: fjogeleit/http-request-action@master
with:
url: https://ci.openmrs.org/rest/api/latest/queue/REFAPP-D3X
url: https://ci.openmrs.org/rest/api/latest/queue/O3-BF
method: "POST"
customHeaders: '{ "Authorization": "Bearer ${{ secrets.BAMBOO_TOKEN }}" }'

0 comments on commit a78d446

Please sign in to comment.