Skip to content

Deploy staging

Deploy staging #26

Workflow file for this run

name: Deploy staging
# Controls when the action will run. Triggers the workflow on push
# events but only for the master branch
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest # The type of runner that the job will run on
steps: # Steps represent a sequence of tasks that will be executed as part of the job
- uses: actions/checkout@v2 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Enter data to .env file
run: |
echo FLOTIQ_BASE_URL=https://api.flotiq.com >> .env.production
echo FLOTIQ_API_KEY="$FLOTIQ_API_KEY" >> .env.production
echo SCOPED_FLOTIQ_API_KEY="$SCOPED_FLOTIQ_API_KEY" >> .env.production
echo GA_MEASUREMENT_ID="$GA_MEASUREMENT_ID" >> .env.production
echo GTM_ID="$GTM_ID" >> .env.production
shell: bash
env:
FLOTIQ_API_KEY: ${{ secrets.FLOTIQ_API_KEY }}
SCOPED_FLOTIQ_API_KEY: ${{ secrets.SCOPED_FLOTIQ_API_KEY }}
GA_MEASUREMENT_ID: ${{ secrets.GA_MEASUREMENT_ID }}
GTM_ID: ${{ secrets.GTM_ID }}
- uses: actions/setup-node@v1
with:
node-version: '20'
- run: yarn install
- name: Gatsby
run: |
npm install -g [email protected]
gatsby clean
gatsby build
# rm -rf public/blog
# mkdir -p public/blog
# find public/ -maxdepth 1 -mindepth 1 -not -name blog -exec mv '{}' public/blog/ \;
# find public/blog -name index.html -exec sed -i 's\window.pagePath="\window.pagePath="/blog\g' {} \;
- name: Cloudflare Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.API_TOKEN }}
accountId: ${{ secrets.ACCOUNT_ID }}
environment: staging