Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 0 additions & 16 deletions .circleci/config.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was actually thinking about the whole github actions vs. circleCi discussion, and I 100% agree that tests/linting/building etc should be run in github actions so that external contributors can get insight into whether their builds are passing or not.

Releasing a new version feels like something that should be protected a little more, and in theory we should get that already with branch protections, but I wouldn't mind having an extra layer of security in that only contentful employees/automation bots that are authorized through circleCI can release code.

100% open to feedback and discussion, I'm still learning how all this works at Contentful, so I might be missing something.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah definitely worth having a discussion about. Another option to consider that could solve the same problem would be an additional branch protection that only allows certain contentful employees (The DX team) to actually merge code into main. If we then only had releases tied to our main workflow, then essentially we're only allowing us to trigger releases.

This file was deleted.

9 changes: 0 additions & 9 deletions .contentful/vault-secrets.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to keep this file vault-secrets.yaml and remove vault-secrets.yml instead

This file was deleted.

13 changes: 9 additions & 4 deletions .github/workflows/pr-build.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: PR Build Check
name: Build

on:
pull_request:
branches: [main]
workflow_call:

jobs:
build:
Expand All @@ -18,7 +17,13 @@ jobs:
cache: 'npm'

- name: Install dependencies
run: npm install
run: npm ci

- name: Run build
run: npm run build

- name: Save Build folders
uses: actions/cache/save@v4
with:
path: build/
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }}
32 changes: 32 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Run Checks

on:
workflow_call:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Restore the build folders
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Do we need to also build before caching?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's taken care of in the build.yml file which runs before the check.yml and is a required pre-req in the main.yml

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uses: actions/cache/restore@v4
with:
path: build/
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }}

- name: Run Prettier
run: npx pretty-quick --check

- name: Run linting
run: npm run lint
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: CI

on:
push:
branches: ['*']
pull_request:
branches: ['*']

jobs:
build:
uses: ./.github/workflows/build.yml

check:
needs: build
uses: ./.github/workflows/check.yml
Loading