Skip to content

Commit

Permalink
Merge pull request #55 from bcgov/ci/bugfixes
Browse files Browse the repository at this point in the history
Update Github Actions pipeline and general housekeeping
  • Loading branch information
mishraomp authored Oct 23, 2024
2 parents 9879cfe + 76b7a40 commit 1e9d018
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 53 deletions.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Autodetect text files and forces unix eols, so Windows does not break them
* text=auto eol=lf

# Force images/fonts to be handled as binaries
*.jpg binary
*.jpeg binary
*.gif binary
*.png binary
73 changes: 41 additions & 32 deletions .github/workflows/main-merge.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,47 @@
name: Deploy to GitHub Pages on push to main
name: Deploy Main to GitHub Pages

on:
push:
branches:
- main

jobs:
build-deploy:
name: Build and Deploy Docusaurus to GitHub Pages
runs-on: ubuntu-24.04
defaults:
run:
working-directory: ./patterns

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: patterns/package-lock.json

- name: Install dependencies
run: npm ci --ignore-scripts
- name: Build website
run: |
export BASE_URL="/nr-architecture-patterns-library" && npm run build
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./patterns/build
clean-exclude: pr-preview/
force: false
jobs:
build-deploy:
name: Build and Deploy Docusaurus to GitHub Pages
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: write
pull-requests: write
defaults:
run:
working-directory: ./patterns
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: patterns/package-lock.json
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Build website
env:
BASE_URL: /nr-architecture-patterns-library
run: npm run build
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: patterns/build
branch: gh-pages
clean-exclude: pr-preview/
single-commit: true # Drop unnecessary commit history from gh-pages
force: true # Set to false if we start losing PR deployment previews
45 changes: 28 additions & 17 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,55 @@
name: PR
name: Deploy PR to Github Pages

on:
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- closed
branches:
- main
workflow_dispatch:
concurrency: preview-${{ github.ref }}
permissions:
contents: write
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-and-deploy:
build-deploy:
name: Build and Deploy to GitHub Pages
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: write
pull-requests: write
defaults:
run:
working-directory: ./patterns
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
fetch-depth: 0
- name: Use Node
uses: actions/setup-node@v4
if: github.event.action != 'closed'
with:
node-version: 20
cache: npm
cache-dependency-path: patterns/package-lock.json

- name: Install dependencies
if: github.event.action != 'closed'
run: npm ci --ignore-scripts
- name: Install Dependencies and Build For PR🔧
run: npm ci --ignore-scripts
- name: Build website
if: github.event.action != 'closed'
env:
BASE_URL: /nr-architecture-patterns-library/pr-preview/pr-${{github.event.number}}
run: |
npm run build
- name: Deploy preview
BASE_URL: /nr-architecture-patterns-library/pr-preview/pr-${{ github.event.pull_request.number }}
run: npm run build
- name: Deploy to/Cleanup GitHub Pages
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./patterns/build
source-dir: ./patterns/build
preview-branch: gh-pages
umbrella-dir: pr-preview
action: auto
12 changes: 11 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# How to contribute
### Not the below will update as we do some initial iterations.

Government employees, public and members of the private sector are encouraged to contribute to the repository by **forking and submitting a pull request**.

(If you are new to GitHub, you might start with a [basic tutorial](https://help.github.com/articles/set-up-git) and check out a more detailed guide to [pull requests](https://help.github.com/articles/using-pull-requests/).)

Pull requests will be evaluated by the repository guardians on a schedule and if deemed beneficial will be committed to the master.

All contributors retain the original copyright to their stuff, but by contributing to this project, you grant a world-wide, royalty-free, perpetual, irrevocable, non-exclusive, transferable license to all users **under the terms of the [license](./LICENSE) under which this project is distributed**.

## Note the below will update as we do some initial iterations

If you are in a developer or architect role and have experience in event-driven architecture, please create a pull request to update specific content or add new content.
Please make sure to provide proper links and implementation details for review.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2024 Province of British Columbia

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# nr-architecture-patterns-library
This repository contains the patterns library from NRM architecture team in confluence space. This is a public view of those library and guidance.
# NR Architecture Patterns Library

This repository contains the patterns library from NRM architecture team in
confluence space. This is a public view of those library and guidance.

0 comments on commit 1e9d018

Please sign in to comment.