Skip to content

generate vehicle-prefixed target envs #196

generate vehicle-prefixed target envs

generate vehicle-prefixed target envs #196

Workflow file for this run

name: build
on:
push:
branches:
- "master"
- "develop"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: cache node_modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node_modules
- name: install npm packages
run: npm install
- name: run indexer
run: npx vite-node src/index.ts
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: targets
path: output/*
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: checkout
uses: actions/checkout@v4
- name: checkout targets
env:
TARGETS_BRANCH: ${{ github.ref_name == 'develop' && 'targets-develop' || 'targets' }}
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git fetch origin "$TARGETS_BRANCH" || true
git checkout -B "$TARGETS_BRANCH" "origin/$TARGETS_BRANCH" || git checkout --orphan "$TARGETS_BRANCH"
git rm -rf .
- uses: actions/download-artifact@v4
with:
name: targets
- name: update targets
env:
TARGETS_BRANCH: ${{ github.ref_name == 'develop' && 'targets-develop' || 'targets' }}
run: |
git add .
git commit -m "Targets $GITHUB_SHA" || exit 0
git remote set-url --push origin https://actions:$GITHUB_TOKEN@github.com/BossHobby/Targets
git push -f origin HEAD:"$TARGETS_BRANCH"