Automated workflows with GitHub Actions for Google Antigravity IDE
# GitHub Actions Workflow Patterns for Google Antigravity
Master continuous integration and deployment with GitHub Actions in Google Antigravity IDE. This comprehensive guide covers workflow configuration, job matrices, caching strategies, deployment automation, and security best practices for modern DevOps.
## Configuration
Configure your Antigravity environment for GitHub Actions:
```typescript
// .antigravity/github-actions.ts
export const actionsConfig = {
features: {
matrixBuilds: true,
caching: true,
artifacts: true,
environments: true
},
security: {
secretsScanning: true,
oidcAuth: true
}
};
```
## CI Workflow
Create comprehensive CI pipeline:
```yaml
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run linter
run: pnpm lint
- name: Type check
run: pnpm type-check
test:
runs-on: ubuntu-latest
needs: lint
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- uses: pnpm/action-setup@v2
with:
version: 8
- run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm test:ci
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test
- name: Upload coverage
uses: codecov/codecov-action@v3
```
## Deployment Workflow
Automate deployments:
```yaml
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: production
url: ${{ steps.deploy.outputs.url }}
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
- name: Login to ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build and push Docker image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/myapp:$IMAGE_TAG .
docker push $ECR_REGISTRY/myapp:$IMAGE_TAG
```
## Best Practices
Follow these guidelines for GitHub Actions:
1. **Use concurrency** - Cancel redundant runs
2. **Cache dependencies** - Speed up workflows
3. **Use OIDC** - Avoid long-lived secrets
4. **Environment protection** - Require approvals
5. **Matrix builds** - Test multiple configurations
6. **Reusable workflows** - Share across repos
Google Antigravity IDE provides intelligent workflow scaffolding and CI/CD optimization suggestions.This GitHub Actions prompt is ideal for developers working on:
By using this prompt, you can save hours of manual coding and ensure best practices are followed from the start. It's particularly valuable for teams looking to maintain consistency across their github actions implementations.
Yes! All prompts on Antigravity AI Directory are free to use for both personal and commercial projects. No attribution required, though it's always appreciated.
This prompt works excellently with Claude, ChatGPT, Cursor, GitHub Copilot, and other modern AI coding assistants. For best results, use models with large context windows.
You can modify the prompt by adding specific requirements, constraints, or preferences. For GitHub Actions projects, consider mentioning your framework version, coding style, and any specific libraries you're using.