Skip to content

Merge pull request #172 from ubud-app/dependabot/npm_and_yarn/yaml-an… #254

Merge pull request #172 from ubud-app/dependabot/npm_and_yarn/yaml-an…

Merge pull request #172 from ubud-app/dependabot/npm_and_yarn/yaml-an… #254

Workflow file for this run

name: Release
on:
push:
branches:
- develop
- main
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [14, 16, 18]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: ${{ matrix.node }}
- uses: actions/cache@v2
id: module-cache
with:
path: node_modules
key: modules-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
- uses: actions/cache@v2
id: npm-cache
with:
path: ~/.npm
key: npm-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
- name: npm ci
if: steps.module-cache.outputs.cache-hit != 'true' || steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- name: test
run: npm run test
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: '18'
- name: npm ci
if: steps.module-cache.outputs.cache-hit != 'true' || steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- run: npm run check
release:
runs-on: ubuntu-latest
needs: [test, check]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: install dependencies
run: npm ci
- name: install zopfli
run: |
npm i -g grunt-cli
git clone https://github.com/google/zopfli.git ./.devcache/zopfli
cd ./.devcache/zopfli
make
cd ../../
- name: semantic-release
run: BRANCH=${GITHUB_REF#refs/heads/} npx semantic-release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_LOG_LEVEL: debug
SENTRY_ORG: ubud
SENTRY_PROJECT: client
SENTRY_URL: ${{ secrets.SENTRY_URL }}
NOTIFY_WEBHOOK_SECRET: ${{ secrets.NOTIFY_WEBHOOK_SECRET }}
- name: update develop
if: ${{ github.ref == 'ref/head/main' }}
uses: everlytic/branch-merge@1.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_ref: 'main'
target_branch: 'develop'
commit_message_template: 'Merge branch {source_ref} into {target_branch} [skip ci]'