From 8c8b8b985e064c0695f296e884b7d41672e2dde6 Mon Sep 17 00:00:00 2001 From: gnezim Date: Wed, 15 Apr 2026 00:53:42 +0300 Subject: [PATCH] Add deploy workflow template for CI/CD pipeline Stub workflow triggered on push to main: build, test, Docker image build. Registry URLs and deployment targets are placeholders pending customer config. --- .github/workflows/deploy.yml | 74 ++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..adc8f2b2 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,74 @@ +# Deploy workflow — template for CI/CD pipeline +# Real registry URLs and deployment targets come from customer (A2/A8) + +name: Deploy + +on: + push: + branches: [main] + +env: + NODE_VERSION: "24" + PNPM_VERSION: "9" + # Placeholder: replace with customer registry + REGISTRY: "registry.example.com" + IMAGE_STANDALONE: "flights-web-standalone" + IMAGE_REMOTE: "flights-web-remote" + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: ${{ env.PNPM_VERSION }} + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Typecheck + run: pnpm typecheck + + - name: Lint + run: pnpm lint + + - name: Test + run: pnpm test + + - name: Build both targets + run: pnpm build:both + + - name: Build Docker images + run: | + docker build -f Dockerfile.react -t ${{ env.REGISTRY }}/${{ env.IMAGE_STANDALONE }}:${{ github.sha }} . + docker build -f Dockerfile.remote -t ${{ env.REGISTRY }}/${{ env.IMAGE_REMOTE }}:${{ github.sha }} . + + # Placeholder: push to customer registry + # - name: Push Docker images + # run: | + # docker push ${{ env.REGISTRY }}/${{ env.IMAGE_STANDALONE }}:${{ github.sha }} + # docker push ${{ env.REGISTRY }}/${{ env.IMAGE_REMOTE }}:${{ github.sha }} + + # Placeholder: deploy to testing environment + # - name: Deploy to testing + # run: | + # echo "Deploy standalone image to testing environment" + # echo "Run post-deploy smoke test" + + # Placeholder: auto-rollback on health-check failure + # - name: Post-deploy health check + # run: | + # curl -f https://testing.example.com/health || echo "Health check failed — trigger rollback"