New color themes #62
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build webadmin FE and Agent | |
on: | |
push: | |
paths: | |
- 'frontend/**' | |
- 'agent/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 2 | |
- name: Extract branch name | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' | |
shell: bash | |
run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" | |
# Check changes | |
- name: Check for changes in dirs | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' | |
shell: bash | |
run: | | |
echo "::set-env name=FE_CHANGES::$(git diff --name-only HEAD HEAD~1 | grep frontend/ | wc -l)" | |
echo "::set-env name=RN_CHANGES::$(git diff --name-only HEAD HEAD~1 | grep agent/ | wc -l)" | |
# Node FE build | |
- name: Set up Node ${{ matrix.node-version }} | |
if: env.FE_CHANGES > 0 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Make ABSOLUTELY sure server address is LOCALHOST and NOTHING ELSE DEFINITELY YES REALLY | |
if: env.FE_CHANGES > 0 | |
working-directory: frontend/public/static | |
run: | | |
sed -i 's/serverAddress.*/serverAddress = "http:\/\/localhost:5000"/g' configuration.js | |
- name: Install deps and build it | |
if: env.FE_CHANGES > 0 | |
working-directory: frontend | |
env: | |
CI: true | |
run: | | |
npm ci | |
npm run build --if-present | |
# Agent build | |
- name: Install mingw g++ | |
if: env.RN_CHANGES > 0 | |
run: sudo apt-get install g++-mingw-w64-x86-64 | |
- name: Build Agent | |
if: env.RN_CHANGES > 0 | |
working-directory: agent | |
run: | | |
bash update_client_bins.sh | |
make clean | |
# Commit & push back | |
- name: Commit files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Assets Builder" | |
git add frontend/public/static/configuration.js | |
git add server/client_bin/windows_x86_64/agent1.exe -f | |
git add server/client_bin/x86_64-pc-linux-gnu/agent1.bin -f | |
git add agent/bin/*.debug -f | |
git add . | |
git commit -m "Build webadmin frontend and agent" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ env.BRANCH_NAME }} |