Skip to content

Commit

Permalink
chore: update CI workflows (#8837)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed Apr 26, 2024
1 parent 65adccc commit 677f096
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 30 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/test.yml
Expand Up @@ -26,14 +26,10 @@ jobs:
node-version: '18.x'

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y mesa-utils xvfb libgl1-mesa-dri libglapi-mesa libosmesa6 libxi-dev
yarn bootstrap
run: yarn bootstrap

- name: Run tests
run: |
xvfb-run -s "-ac -screen 0 1280x1024x16" yarn test-ci
run: yarn test-ci

- name: Coveralls
uses: coverallsapp/github-action@09b709cf6a16e30b0808ba050c7a6e8a5ef13f8d # v1.2.5
Expand Down
47 changes: 23 additions & 24 deletions .github/workflows/website.yml
Expand Up @@ -5,52 +5,51 @@ on:
branches:
- '*-release'

permissions:
contents: read

jobs:
publish-website:
check_branch:
runs-on: ubuntu-latest
outputs:
should_deploy: ${{ endsWith(github.ref, steps.get_version.outputs.latest) }}

steps:
- name: Get version
id: get_version
run: |
LATEST=$(npm show deck.gl@latest version | grep -o -E "^[0-9]+\.[0-9]+")
echo "latest=${LATEST}-release" >> "$GITHUB_OUTPUT"
if: github.repository_owner == 'visgl'
deploy:
runs-on: ubuntu-latest
needs: check_branch

permissions:
contents: write

env:
MapboxAccessToken: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
GoogleMapsAPIKey: ${{ secrets.GOOGLE_MAPS_API_KEY }}
GoogleMapsMapId: ${{ secrets.GOOGLE_MAPS_MAP_ID }}
if: ${{ github.repository_owner == 'visgl' && needs.check_branch.outputs.should_deploy }}

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
token: ${{ secrets.ADMIN_TOKEN }}
token: ${{ secrets.WEBSITE_DEPLOY_TOKEN }}

- name: Use Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: '18.x'

- name: Get version
id: get-version
run: LATEST=$(npm show deck.gl version | grep -o -E "^[0-9]+\.[0-9]+") && echo "::set-output name=latest::/${LATEST}-release"

- name: Check version
if: ${{ !endsWith(github.ref, steps.get-version.outputs.latest) }}
- name: Install dependencies
run: |
echo "Website is only published from the latest release branch"
yarn bootstrap
(cd website && yarn)
- name: Build website
if: ${{ endsWith(github.ref, steps.get-version.outputs.latest) }}
run: |
yarn bootstrap
cd website
yarn
yarn build
env:
MapboxAccessToken: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
GoogleMapsAPIKey: ${{ secrets.GOOGLE_MAPS_API_KEY }}
GoogleMapsMapId: ${{ secrets.GOOGLE_MAPS_MAP_ID }}
run: (cd website && yarn build)

- name: Deploy
if: ${{ endsWith(github.ref, steps.get-version.outputs.latest) }}
uses: JamesIves/github-pages-deploy-action@132898c54c57c7cc6b80eb3a89968de8fc283505 # 3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 677f096

Please sign in to comment.