Skip to content

Commit

Permalink
Merge pull request #484 from France-ioi/circleci-deploy
Browse files Browse the repository at this point in the history
CircleCI continuous deployment
  • Loading branch information
SebastienTainon authored May 6, 2024
2 parents 753d63e + b2f0029 commit d301607
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
version: 2.1

orbs:
node: circleci/[email protected]

jobs:
build:
executor: node/default
steps:
- checkout
- run:
name: "Setup Node auth token"
command: |
echo "registry=https://registry.npmjs.org/" >> ~/.npmrc
echo "@france-ioi:registry=https://npm.pkg.github.com/" >> ~/.npmrc
echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc
- run:
name: "Fetch submodules"
command: git submodule update --init
- node/install-packages:
pkg-manager: yarn
- run:
name: "Copy config"
command: cp config.json.template config.json
- run:
name: "Build Codecast lib"
command: yarn build-lib
- persist_to_workspace:
root: .
paths:
- 'build'
commit:
machine: true
steps:
- attach_workspace:
at: .
- run:
name: "Clone bebras-modules"
command: git clone https://${GITHUB_USERNAME}:${NODE_AUTH_TOKEN}@github.com/France-ioi/bebras-modules.git
- run:
name: "Copy new files"
command: |
ls -asl build
cp build/index.js bebras-modules/ext/codecast/7.4/index.js
cp build/index.css bebras-modules/ext/codecast/7.4/index.css
cp build/index.worker.worker.js bebras-modules/ext/codecast/7.4/index.worker.worker.js
- run:
name: "Commit changes"
command: |
cd bebras-modules
git config credential.helper cache
git config user.email "[email protected]"
git config user.name "Deployment"
git add .
git commit --allow-empty -m "Upgrade Codecast 7.4"
- run:
name: "Push changes"
command: |
cd bebras-modules
git push -u origin master
workflows:
deploy:
jobs:
- build:
filters:
branches:
only: lib
- commit:
requires:
- build
filters:
branches:
only: lib

0 comments on commit d301607

Please sign in to comment.