Skip to content

chore: update docs deploy script #167

chore: update docs deploy script

chore: update docs deploy script #167

Workflow file for this run

name: CI
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
# Match SemVer major release branches, e.g. "2.x" or ".x"
- '[0-9]+.x'
- 'main'
- 'next'
- 'alpha'
- 'beta'
- 'develop'
- '!all-contributors/**'
env:
NODE_VERSION: "16.x"
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "${{ env.NODE_VERSION }}"
- name: Cache node modules
id: cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
eslint:
name: Eslint
runs-on: ubuntu-latest
needs: [setup]
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: "${{ env.NODE_VERSION }}"
- name: Fetch all branches
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
- name: ESLint
run: npm run ci:lint -- $(git diff --diff-filter d --name-only origin/${{ github.base_ref }}...HEAD -- '*.js' '*.ts' '*.tsx')
typescript:
name: Typescript
runs-on: ubuntu-latest
needs: [setup]
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "${{ env.NODE_VERSION }}"
- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
- name: Typescript
run: npm run ci:tsc
tests:
name: Tests
runs-on: ubuntu-latest
needs: [setup]
timeout-minutes: 5
strategy:
matrix:
leaflet: ["1.6.0", "1.7.1", "1.8.0"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "${{ env.NODE_VERSION }}"
- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
- name: install specific leaflet version
run: npm install leaflet@${{ matrix.leaflet }}
- name: unit tests
run: npm run ci:test
env:
GATSBY_BING_API_KEY: ${{ secrets.BING_API_KEY }}
GATSBY_GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
GATSBY_LOCATIONIQ_API_KEY: ${{ secrets.LOCATIONIQ_API_KEY }}
GATSBY_OPENCAGE_API_KEY: ${{ secrets.OPENCAGE_API_KEY }}
GATSBY_HERE_API_KEY: ${{ secrets.HERE_API_KEY }}
update-docs:
name: Update docs
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
needs: [tests, typescript]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: "${{ env.NODE_VERSION }}"
- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
- name: setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: update docs
run: npm run docs:update
release:
needs: [tests, typescript]
if: github.event_name == 'push' && github.repository == 'smeijer/leaflet-geosearch'
runs-on: ubuntu-latest
environment: npm
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '${{ env.NODE_VERSION }}'
- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
- name: Build
run: npm run build
- name: Release
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 17
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'next',
'develop',
{ name: 'alpha', prerelease: true },
{ name: 'beta', prerelease: true }
]
env:
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}