Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rfac: split actions across multiple jobs #231

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 34 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ on:
pull_request:
branches: [main]

env:
AWS_DEFAULT_REGION: us-east-1
AWS_BACKUP_REGION: eu-central-1
CLOUDFLARE_ACCOUNT_ID: 895762025d37fc687ecd72d7cc80204a
CLOUDFLARE_ZONE_ID: c192cf8ac042c681023493c52edd44c8

jobs:
build:

test:
runs-on: ubuntu-latest-xl
env:
AWS_DEFAULT_REGION: us-east-1
AWS_BACKUP_REGION: eu-central-1
CLOUDFLARE_ACCOUNT_ID: 895762025d37fc687ecd72d7cc80204a
CLOUDFLARE_ZONE_ID: c192cf8ac042c681023493c52edd44c8
steps:
- name: Setup Deno environment
wperron marked this conversation as resolved.
Show resolved Hide resolved
uses: denolib/setup-deno@v2.3.0
Expand All @@ -30,17 +32,20 @@ jobs:
- name: Lint
run: deno lint --unstable

- name: Docker build
run: make build

- name: Test
run: make test

- name: Validate
run: |
terraform init -backend=false
terraform validate
working-directory: terraform
build:
needs: test
runs-on: ubuntu-latest-xl
steps:
- name: Setup Deno environment
uses: denolib/setup-deno@v2.3.0
with:
deno-version: v1.6.2

- name: Docker build
run: make build

- name: Push container to ECR (prod)
if: github.ref == 'refs/heads/main'
Expand All @@ -53,6 +58,21 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

deploy:
needs: build
runs-on: ubuntu-lastest-xl
steps:
- name: Setup Deno environment
uses: denolib/setup-deno@v2.3.0
with:
deno-version: v1.6.2

- name: Validate
run: |
terraform init -backend=false
terraform validate
working-directory: terraform

- name: Create terraform plan (prod)
if: github.ref == 'refs/heads/main'
Expand Down