Skip to content

.github/workflows/stageBuild.yml #11

.github/workflows/stageBuild.yml

.github/workflows/stageBuild.yml #11

Workflow file for this run

name: DevTools Stage Frontend CI
on:
workflow_dispatch:
inputs:
version:
description: "Version to build (e.g. v1, v2, v3)"
required: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
STAGE_BUCKET: stage-falcon-component-v1
AWS_REGION: us-east-1
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Clone depot_tools
run: |
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
- name: Add depot_tools to PATH
run: |
echo "${{ github.workspace }}/depot_tools" >> $GITHUB_PATH
- name: Fetch Chrome DevTools
run: |
export PATH="${{ github.workspace }}/depot_tools:$PATH"
fetch devtools-frontend
cd devtools-frontend
gclient sync --with_branch_heads
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ github.event.inputs.NODE_VERSION }}
- name: Build Chrome DevTools
run: |
npm install
npm run build
working-directory: devtools-frontend
- name: Find DevTools build folder
id: find_frontend_dir
run: |
FRONTEND_DIR=$(find devtools-frontend/out -type f -name "devtools_app.html" -exec dirname {} \;)
if [ -z "$FRONTEND_DIR" ]; then
echo "Error: build folder not found!"
exit 1
fi
echo "Detected frontend directory: $FRONTEND_DIR"
echo "FRONTEND_DIR=$FRONTEND_DIR" >> $GITHUB_ENV
- name: Print versions
run: |
node -v
npm -v
- name: List built files
run: ls -altr ${{ env.FRONTEND_DIR }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }}
aws-region: ${{ env.AWS_REGION }}
- name: Upload to S3
run: |
BUCKET=${{ env.STAGE_BUCKET }}
echo "Uploading to S3 bucket: $BUCKET/${{ inputs.version }}"
aws s3 sync "${{ env.FRONTEND_DIR }}" s3://$BUCKET/${{ inputs.version }}/ \
--acl public-read --follow-symlinks --delete
- name: Verify S3 Upload
run: |
BUCKET=${{ env.STAGE_BUCKET }}
echo "Verifying S3 bucket: $BUCKET/${{ inputs.version }}"
aws s3 ls s3://$BUCKET/${{ inputs.version }}/