Skip to content

Commit

Permalink
chore: move build to GH actions (#147)
Browse files Browse the repository at this point in the history
* chore: move build to GH actions

ref: UUI-241

* Update .github/workflows/deploy.yml

Co-authored-by: Paweł Wójcik <[email protected]>

* Update .gitignore

* Update readme and remove contributors file
  • Loading branch information
bogdan-niculescu-sch authored Jan 25, 2024
1 parent 72eaa98 commit cb9d3fb
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 42 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Trigger build

on:
push:
tags: '*'

jobs:
build:
runs-on: ubuntu-latest
name: Run js tests
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run tests
run: |
npm run lint
npm run build
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run script
default: ./scripts/internal_travis_trigger.sh
env:
INTERNAL_TRAVIS_TOKEN: ${{secrets.INTERNAL_TRAVIS_TOKEN}}
29 changes: 29 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test pull request

on:
pull_request:
types:
- opened
- reopened
- synchronize
push:
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
name: Run js tests
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run tests
run: |
npm run lint
npm run build
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.DS_Store
.env
.idea
.yalc
dist
node_modules/
.idea
Expand Down
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

11 changes: 0 additions & 11 deletions CONTRIBUTORS.md

This file was deleted.

19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SDK Example

[![Build Status](https://travis-ci.org/schibsted/sdk-example.svg?branch=master)](https://travis-ci.org/schibsted/sdk-example)
[![Build Status](https://github.com/schibsted/sdk-example/actions/workflows/pr.yml/badge.svg?branch=master)](https://github.com/schibsted/sdk-example)

## Introduction

Expand All @@ -11,30 +11,27 @@ live at:
* [https://pre.sdk-example.com](https://pre.sdk-example.com)
* [https://dev.sdk-example.com](https://dev.sdk-example.com)

The main intention of this code is to have simplified demo of the most important features of [SDK](https://github.com/schibsted/account-sdk-browser)
The main intention of this code is to have a simplified demo of the most important features of [SDK for browsers](https://github.com/schibsted/account-sdk-browser)

## How to run locally?
## How to run it locally?
1. Clone this repo.
1. Install dependencies `npm run install`.
1. And run `npm run dev` script.

## Configuring the server

1. You need a few configs obtained from Self-service *in the right environment* in order to get
1. You need a few configs obtained from Self-Service *in the right environment* in order to get
started. Set your Identity client credentials in the `.env` file in the root folder. To get a
head start you can just copy a template that's already included in the repo (run: `cp
.env-example .env` and fill in the blanks. Take a look at [.env-example](./.env-example) to
see what is needed.
1. Then do a `source .env && npm start` or `npm run dev`.

## Repo structure
To make this Example app running, simple backend application is exposed.
## Repository structure
For this Example app a simple backend application is exposed.

### Backend
Main directory for backend application is placed directory
```
/server
```
The contents for the backend application can be found in the `/server` directory.

### Account-sdk-browser usage
All browser code is placed in `/public` directory, and usage of SDK can be found in this file [index.js](public/index.js)
The frontend code is placed in the `/public` directory, and usage of SDK can be found in [index.js](public/index.js).

0 comments on commit cb9d3fb

Please sign in to comment.