-
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.
- Loading branch information
Showing
4 changed files
with
73 additions
and
35 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 |
---|---|---|
|
@@ -32,22 +32,48 @@ jobs: | |
git config user.name "github-actions[bot]" | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
CURRENT_VERSION=$(node -p "require('./lerna.json').version") | ||
git tag v${CURRENT_VERSION} -m v${CURRENT_VERSION} | ||
git tag v${CURRENT_VERSION} -m v${CURRENT_VERSION} || true | ||
git push --tags | ||
- name: Deploy - Bundle | ||
if: github.ref != 'refs/heads/master' || github.repository != 'linz/basemaps' | ||
run: npx lerna run bundle --stream | ||
- name: (Prod) Create github release | ||
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:') | ||
run: npx conventional-github-releaser -p angular | ||
env: | ||
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
- name: (Prod) Publish NPM | ||
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:') | ||
run: npx lerna publish from-git --yes | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN_LINZJS}} | ||
|
||
- name: Benchmark | ||
uses: blacha/hyperfine-action@v1 | ||
|
||
deploy-nonprod: | ||
runs-on: ubuntu-latest | ||
concurrency: deploy-${{ github.ref }} | ||
needs: [build-deploy] | ||
if: github.ref == 'refs/heads/master' && github.repository == 'linz/basemaps' | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
steps: | ||
- uses: linz/action-typescript@v2 | ||
# pulls all tags (needed for lerna to correctly version) | ||
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* # see https://stackoverflow.com/a/60184319/9285308 | ||
|
||
- name: (NonProd) Configure AWS Credentials | ||
if: github.ref == 'refs/heads/master' && github.repository == 'linz/basemaps' | ||
uses: aws-actions/[email protected] | ||
with: | ||
aws-region: ap-southeast-2 | ||
mask-aws-account-id: true | ||
role-to-assume: ${{ secrets.AWS_ROLE_NON_PROD }} | ||
|
||
- name: (NonProd) Deploy | ||
if: github.ref == 'refs/heads/master' && github.repository == 'linz/basemaps' | ||
run: | | ||
npx lerna run bundle --stream | ||
npm pack --workspaces | ||
|
@@ -59,21 +85,32 @@ jobs: | |
NODE_ENV: 'dev' | ||
|
||
- name: (NonProd) After Deploy Smoke Test | ||
if: github.ref == 'refs/heads/master' && github.repository == 'linz/basemaps' | ||
run: | | ||
cd packages/smoke | ||
node --test | ||
deploy-prod: | ||
runs-on: ubuntu-latest | ||
concurrency: deploy-${{ github.ref }} | ||
needs: [deploy-nonprod] | ||
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:') | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
steps: | ||
- uses: linz/action-typescript@v2 | ||
# pulls all tags (needed for lerna to correctly version) | ||
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* # see https://stackoverflow.com/a/60184319/9285308 | ||
|
||
- name: (Prod) Configure AWS Credentials | ||
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:') | ||
uses: aws-actions/[email protected] | ||
with: | ||
aws-region: ap-southeast-2 | ||
mask-aws-account-id: true | ||
role-to-assume: ${{ secrets.AWS_ROLE_PROD }} | ||
|
||
- name: (Prod) Deploy | ||
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:') | ||
run: | | ||
npx lerna run bundle --stream | ||
npm pack --workspaces | ||
|
@@ -83,19 +120,3 @@ jobs: | |
NODE_ENV: 'production' | ||
GOOGLE_ANALYTICS: ${{secrets.GOOGLE_ANALYTICS_PROD}} | ||
SPLIT_IO_KEY: ${{secrets.SPLIT_IO_KEY_PROD}} | ||
|
||
- name: (Prod) Create github release | ||
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:') | ||
run: npx conventional-github-releaser -p angular | ||
env: | ||
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
- name: (Prod) Publish NPM | ||
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:') | ||
run: npx lerna publish from-git --yes | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN_LINZJS}} | ||
|
||
- name: Benchmark | ||
uses: blacha/hyperfine-action@v1 |
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
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
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