-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sticking with Node 14 for now to match Emscripten.
- Loading branch information
1 parent
19afbf0
commit fc2093b
Showing
4 changed files
with
76 additions
and
143 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,52 @@ | ||
name: build | ||
|
||
on: | ||
release: | ||
types: [created] | ||
push: | ||
branches: | ||
- "**" | ||
|
||
# This is conservative: ideally we'd include branch and stage in this key | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency | ||
concurrency: deploy-python-simulator | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: read | ||
env: | ||
AWS_DEFAULT_REGION: eu-west-1 | ||
PRODUCTION_CLOUDFRONT_DISTRIBUTION_ID: E15FPP46STH15O | ||
STAGING_CLOUDFRONT_DISTRIBUTION_ID: E15FPP46STH15O | ||
REVIEW_CLOUDFRONT_DISTRIBUTION_ID: E2DW5F7PA9W7JD | ||
|
||
steps: | ||
# Note: This workflow will not run on forks without modification; we're open to making steps | ||
# that rely on our deployment infrastructure conditional. Please open an issue. | ||
- uses: actions/checkout@v3 | ||
- name: Configure node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14.x | ||
cache: "npm" | ||
registry-url: "https://npm.pkg.github.com" | ||
- run: npm ci | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- run: npm install --no-save @microbit-foundation/[email protected] @microbit-foundation/[email protected] @microbit-foundation/circleci-npm-package-versioner@1 | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- run: node ./bin/print-ci-env.js >> $GITHUB_ENV | ||
- run: npm run ci:update-version | ||
- run: ./ci-build.sh | ||
- run: npm run deploy | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.WEB_DEPLOY_AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.WEB_DEPLOY_AWS_SECRET_ACCESS_KEY }} | ||
- run: npm run invalidate | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.WEB_DEPLOY_AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.WEB_DEPLOY_AWS_SECRET_ACCESS_KEY }} |
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,12 @@ | ||
name: "pr-url" | ||
on: | ||
pull_request: | ||
types: [opened] | ||
jobs: | ||
pr-url: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: microbit-foundation/[email protected] | ||
with: | ||
uri-template: "https://review-python-simulator.usermbit.org/{branch}/" | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
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,12 @@ | ||
#!/usr/bin/env node | ||
const ref = process.env.GITHUB_REF; | ||
let stage; | ||
if (ref === "refs/heads/main") { | ||
stage = "STAGING"; | ||
} else if (ref.startsWith("refs/tags/v")) { | ||
stage = "PRODUCTION"; | ||
} else { | ||
stage = "REVIEW"; | ||
} | ||
|
||
console.log(`STAGE=${stage}`); |