-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #484 from France-ioi/circleci-deploy
CircleCI continuous deployment
- Loading branch information
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |