Skip to content

Commit

Permalink
chore(web): ci for web build
Browse files Browse the repository at this point in the history
  • Loading branch information
mfazekas committed May 26, 2024
1 parent 7806111 commit 78aeece
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/ci-requiring-tokens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,17 @@ jobs:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.MAPBOX_DOWNLOAD_TOKEN }}
ENV_MAPBOX_ACCESS_TOKEN: ${{ secrets.ENV_MAPBOX_ACCESS_TOKEN }}
ENV_MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.ENV_MAPBOX_DOWNLOAD_TOKEN }}
ENV_MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.ENV_MAPBOX_DOWNLOAD_TOKEN }}

call_web_workflow:
name: "Web/Mapbox"
uses: ./.github/workflows/web-actions.yml
with:
env_name: ${{ inputs.env_name }}
ref: ${{ inputs.ref }}
NVMRC: ${{ inputs.NVMRC }}
secrets:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.MAPBOX_DOWNLOAD_TOKEN }}
ENV_MAPBOX_ACCESS_TOKEN: ${{ secrets.ENV_MAPBOX_ACCESS_TOKEN }}
ENV_MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.ENV_MAPBOX_DOWNLOAD_TOKEN }}
59 changes: 59 additions & 0 deletions .github/workflows/web-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Web Build

on:
workflow_call:
inputs:
env_name:
required: true
default: default
type: string
ref:
required: false
type: string
NVMRC:
required: true
type: string
secrets:
MAPBOX_ACCESS_TOKEN:
required: true
MAPBOX_DOWNLOAD_TOKEN:
required: true
ENV_MAPBOX_ACCESS_TOKEN:
required: false
ENV_MAPBOX_DOWNLOAD_TOKEN:
required: false

jobs:
build_example:
name: Example Build for Web
runs-on: ubuntu-latest
environment: ${{ inputs.env_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
if: ${{ inputs.ref == '' }}

- name: Checkout fork
uses: actions/checkout@v4
if: ${{ inputs.ref != '' }}
with:
ref: ${{ inputs.ref }}

- name: Setup node ${{ inputs.NVMRC }}
uses: actions/[email protected]
with:
node-version: ${{ inputs.NVMRC }}

- run: echo $MAPBOX_ACCESS_TOKEN > ./accesstoken
working-directory: example
env:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN || secrets.ENV_MAPBOX_ACCESS_TOKEN }}

- run: yarn install --network-timeout 1000000
working-directory: example

- run: yarn postinstall
working-directory: example

- run: npx expo export --platform web
working-directory: example

0 comments on commit 78aeece

Please sign in to comment.