Skip to content

Commit b00bf28

Browse files
authored
CCI to GHA migration
This merge sunsets the CircleCI deployment workflow and replaces it with a GHA workflow.
2 parents 135b4dc + d958545 commit b00bf28

File tree

4 files changed

+119
-65
lines changed

4 files changed

+119
-65
lines changed

.circleci/config.yml

Lines changed: 64 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,69 @@
1+
# version: 2.1
2+
# orbs:
3+
# commitlint: conventional-changelog/[email protected]
4+
# node: circleci/[email protected]
15

2-
version: 2.1
3-
orbs:
4-
commitlint: conventional-changelog/[email protected]
5-
node: circleci/[email protected]
6+
# jobs:
7+
# build-and-test:
8+
# executor:
9+
# name: node/default
10+
# resource_class: medium
11+
# tag: '16.19'
12+
# steps:
13+
# - checkout
14+
# - node/install-packages
15+
# - run: npm run build
16+
# - run: npm run test
17+
# - persist_to_workspace:
18+
# root: ~/project
19+
# paths:
20+
# - .
21+
# deploy:
22+
# executor:
23+
# name: node/default
24+
# resource_class: medium
25+
# tag: '16.19'
26+
# steps:
27+
# - attach_workspace:
28+
# at: ~/project
29+
# - run: npm run semantic-release
630

7-
jobs:
8-
build-and-test:
9-
executor:
10-
name: node/default
11-
resource_class: medium
12-
tag: '16.19'
13-
steps:
14-
- checkout
15-
- node/install-packages
16-
- run: npm run build
17-
- run: npm run test
18-
- persist_to_workspace:
19-
root: ~/project
20-
paths:
21-
- .
22-
deploy:
23-
executor:
24-
name: node/default
25-
resource_class: medium
26-
tag: '16.19'
27-
steps:
28-
- attach_workspace:
29-
at: ~/project
30-
- run: npm run semantic-release
31+
# workflows:
32+
# commitlint:
33+
# when:
34+
# not:
35+
# or:
36+
# - equal: [ master, <<pipeline.git.branch>> ]
37+
# - equal: [ develop, <<pipeline.git.branch>> ]
38+
# - matches: { pattern: "^hotfix.*", value: <<pipeline.git.branch>> }
39+
# - matches: { pattern: "^release.*", value: <<pipeline.git.branch>> }
40+
# jobs:
41+
# - commitlint/lint:
42+
# target-branch: develop
3143

32-
workflows:
33-
commitlint:
34-
when:
35-
not:
36-
or:
37-
- equal: [ master, <<pipeline.git.branch>> ]
38-
- equal: [ develop, <<pipeline.git.branch>> ]
39-
- matches: { pattern: "^hotfix.*", value: <<pipeline.git.branch>> }
40-
- matches: { pattern: "^release.*", value: <<pipeline.git.branch>> }
41-
jobs:
42-
- commitlint/lint:
43-
target-branch: develop
44+
# build-and-test-workflow:
45+
# when:
46+
# not:
47+
# or:
48+
# - equal: [ master, <<pipeline.git.branch>> ]
49+
# - equal: [ develop, <<pipeline.git.branch>> ]
50+
# - matches: { pattern: "^hotfix.*", value: <<pipeline.git.branch>> }
51+
# - matches: { pattern: "^release.*", value: <<pipeline.git.branch>> }
52+
# jobs:
53+
# - build-and-test
4454

45-
build-and-test-workflow:
46-
when:
47-
not:
48-
or:
49-
- equal: [ master, <<pipeline.git.branch>> ]
50-
- equal: [ develop, <<pipeline.git.branch>> ]
51-
- matches: { pattern: "^hotfix.*", value: <<pipeline.git.branch>> }
52-
- matches: { pattern: "^release.*", value: <<pipeline.git.branch>> }
53-
jobs:
54-
- build-and-test
55+
# deploy-workflow:
56+
# when:
57+
# or:
58+
# - equal: [ master, <<pipeline.git.branch>> ]
59+
# - equal: [ develop, <<pipeline.git.branch>> ]
60+
# - matches: { pattern: "^hotfix.*", value: <<pipeline.git.branch>> }
61+
# - matches: { pattern: "^release.*", value: <<pipeline.git.branch>> }
5562

56-
deploy-workflow:
57-
when:
58-
or:
59-
- equal: [ master, <<pipeline.git.branch>> ]
60-
- equal: [ develop, <<pipeline.git.branch>> ]
61-
- matches: { pattern: "^hotfix.*", value: <<pipeline.git.branch>> }
62-
- matches: { pattern: "^release.*", value: <<pipeline.git.branch>> }
63-
64-
jobs:
65-
- build-and-test
66-
- deploy:
67-
context:
68-
- scratch-npm-creds
69-
requires:
70-
- build-and-test
63+
# jobs:
64+
# - build-and-test
65+
# - deploy:
66+
# context:
67+
# - scratch-npm-creds
68+
# requires:
69+
# - build-and-test

.github/CODEOWNERS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@scratchfoundation/scratch-engineering

.github/workflows/ci-cd.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI/CD
2+
3+
on:
4+
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
5+
pull_request: # Runs whenever a pull request is created or updated
6+
push: # Runs whenever a commit is pushed to the repository
7+
branches: [master, develop, hotfix/*, release]
8+
9+
concurrency:
10+
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
11+
cancel-in-progress: true
12+
13+
permissions:
14+
contents: write # publish a GitHub release
15+
pages: write # deploy to GitHub Pages
16+
issues: write # comment on released issues
17+
pull-requests: write # comment on released pull requests
18+
19+
jobs:
20+
ci-cd:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: wagoid/commitlint-github-action@v5
26+
if: github.event_name == 'pull_request'
27+
28+
- uses: actions/setup-node@v3
29+
with:
30+
cache: "npm"
31+
node-version-file: ".nvmrc"
32+
33+
- name: Info
34+
run: |
35+
cat <<EOF
36+
Node version: $(node --version)
37+
NPM version: $(npm --version)
38+
GitHub ref: ${{ github.ref }}
39+
GitHub head ref: ${{ github.head_ref }}
40+
EOF
41+
42+
- name: Setup & Test
43+
run: |
44+
npm ci
45+
npm run build
46+
npm run test
47+
48+
- name: Semantic release (configured to run dry if branch is other than 'develop')
49+
env:
50+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
run: |
53+
npx --no -- semantic-release

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v16

0 commit comments

Comments
 (0)