Skip to content

Commit

Permalink
Merge pull request #151 from reload/relative-ci-main
Browse files Browse the repository at this point in the history
Add Relative CI (main branch)
  • Loading branch information
cableman authored Sep 27, 2022
2 parents d691f07 + e0aa650 commit a75ea2b
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 30 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build

on:
push:
pull_request:

jobs:
build:
name: Build artifacts
if: '!github.event.deleted'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Required to fetch all commits and tags
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
registry-url: 'https://npm.pkg.github.com'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Dependencies
run: yarn install
- name: Build artifacts
run: |
yarn build:css:prod
VERSION_FILE_NAME=$GITHUB_REPOSITORY \
VERSION_FILE_VERSION=$(git describe --tags --exclude=latest) \
yarn build:js:prod --json webpack-stats.json
- name: Upload build
uses: actions/upload-artifact@v1
with:
name: dist
path: dist
- name: Upload webpack stats artifact
uses: relative-ci/agent-upload-artifact-action@v1
with:
webpackStatsFile: ./webpack-stats.json
30 changes: 0 additions & 30 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,36 +75,6 @@ jobs:
- name: Lint Javascript
run: yarn lint:js

build:
name: Build artifacts
if: '!github.event.deleted'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Required to fetch all commits and tags
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
registry-url: 'https://npm.pkg.github.com'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Dependencies
run: yarn install
- name: Build artifacts
run: |
VERSION_FILE_NAME=$GITHUB_REPOSITORY \
VERSION_FILE_VERSION=$(git describe --tags --exclude=latest) \
yarn build
- name: Upload
uses: actions/upload-artifact@v1
with:
name: dist
path: dist

validate_docs:
name: Validate documentation
if: '!github.event.deleted'
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/relative_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: RelativeCI

on:
workflow_run:
workflows: ["Build"]
types:
- completed

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Send webpack stats to RelativeCI
uses: relative-ci/agent-action@v2
with:
key: ${{ secrets.RELATIVE_CI_KEY }}
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a75ea2b

Please sign in to comment.