Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Commit

Permalink
feat: use open sauced semantic release configuration (#1120)
Browse files Browse the repository at this point in the history
* feat: add semantic-release configuration dependencies

* feat: remove stardard-version artifacts and update semantic-release

* feat: added minimalistic docker build

* feat: add under-engineered release workflow

closes #1107

* fix: add missing commitizen conventional commit defaults

* fix: correct static distribution github release path

* docs: simplify workflows by code splitting docs
  • Loading branch information
0-vortex committed Aug 3, 2021
1 parent 0950827 commit df74d24
Show file tree
Hide file tree
Showing 38 changed files with 34,495 additions and 55,622 deletions.
3 changes: 3 additions & 0 deletions .czrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"path": "./node_modules/cz-conventional-changelog"
}
41 changes: 0 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,44 +27,3 @@ jobs:
npm ci
npm audit --production
npm test
- name: Release
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: |
git config --global user.name ${GITHUB_ACTOR}
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
npm run release
git push --follow-tags origin main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docusaurus:
name: 📖 Documentation
if: github.ref == 'refs/heads/main' && github.event_name == 'push'

needs: [ build ]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16

- name: Install npm@7
run: npm i -g npm@7

- name: npm install and test
run: |
cd docs
npm ci --production
npm run build
- name: Deploy to static branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build
commit_message: ${{ github.event.head_commit.message }}
enable_jekyll: false
cname: docs.opensauced.pizza
Original file line number Diff line number Diff line change
@@ -1,37 +1,20 @@
name: "PR Audit"
name: "Compliance"

on:
pull_request_target:
types:
- opened
- edited
- synchronize
branches:
- "release/*"
- "patch/*"
- main

jobs:
semantics:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v1.2.0
- uses: amannn/action-semantic-pull-request@v3.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

audit:
runs-on: ubuntu-latest
if: github.event.check_suite.app.name == 'Netlify' && github.event.check_suite.conclusion == 'success'

steps:
- name: Audit Netlify deploy preview
uses: jakejarvis/lighthouse-action@master
with:
netlify_site: 'open-sauced.netlify.app'
- uses: actions/upload-artifact@master
with:
name: report
path: './report'

welcome:
runs-on: ubuntu-latest
needs: semantics
Expand Down
175 changes: 175 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
name: "Release"

on:
push:
branches:
- main

jobs:
docker:
name: Build container
runs-on: ubuntu-latest
steps:
- name: "☁️ checkout repository"
uses: actions/checkout@v2

- name: "🔧 setup buildx"
uses: docker/setup-buildx-action@v1

- name: "📦 docker build"
uses: docker/build-push-action@v2
with:
context: .
tags: ${{ github.repository }}:latest
outputs: type=docker,dest=/tmp/docker.tar
push: false

- name: "📂 docker artifacts"
uses: actions/upload-artifact@v2
with:
name: docker
path: /tmp/docker.tar

build:
name: Build application
runs-on: ubuntu-latest
steps:
- name: "☁️ checkout repository"
uses: actions/checkout@v2

- name: "🔧 setup node"
uses: actions/setup-node@v2.1.5
with:
node-version: 16

- name: "🔧 setup cache"
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/npm-shrinkwrap.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: "🔧 install npm@7"
run: npm i -g npm@7

- name: "📦 install dependencies"
run: npm ci

- name: "🚀 static app"
run: npm run build

- name: "📂 production artifacts"
uses: actions/upload-artifact@v2
with:
name: build
path: build

lint:
name: Code standards
runs-on: ubuntu-latest
steps:
- name: "☁️ checkout repository"
uses: actions/checkout@v2

- name: "🔧 setup node"
uses: actions/setup-node@v2.1.5
with:
node-version: 16

- name: "🔧 setup cache"
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/npm-shrinkwrap.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: "🔧 install npm@7"
run: npm i -g npm@7

- name: "📦 install dependencies"
run: npm ci

- name: "🔍 lint code"
run: npm run lint

release:
environment:
name: production
url: https://github.com/${{ github.repository }}/releases/tag/v${{ steps.release.outputs.version }}
name: Semantic release
needs:
- docker
- build
- lint
runs-on: ubuntu-latest
steps:
- name: "☁️ checkout repository"
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: "🔧 setup node"
uses: actions/setup-node@v2.1.5
with:
node-version: 16

- name: "🔧 setup cache"
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/npm-shrinkwrap.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: "🔧 install npm@7"
run: npm i -g npm@7

- name: "📦 install dependencies"
run: npm ci

- name: "📂 download docker artifacts"
uses: actions/download-artifact@v2
with:
name: docker
path: /tmp

- name: "📦 load tag"
run: |
docker load --input /tmp/docker.tar
docker image ls -a
- name: "📂 download build artifacts"
uses: actions/download-artifact@v2
with:
name: build
path: /tmp/build

- name: "🚀 release"
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_OWNER: ${{ github.repository_owner }}
GIT_AUTHOR_NAME: ${{ github.event.commits[0].author.username }}
GIT_AUTHOR_EMAIL: ${{ github.event.commits[0].author.email }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
run: |
cp -R /tmp/build ./build
npx semantic-release
echo "::set-output name=version::$(cat package.json | jq -r '.version')"
cleanup:
name: Cleanup actions
needs:
- release
runs-on: ubuntu-latest
steps:
- name: "♻️ remove build artifacts"
uses: geekyeggo/delete-artifact@v1
with:
name: |
build
docs
docker
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
name: Assign
name: "Triage"

on:
issue_comment:
types: [created, edited]
types:
- created
- edited

jobs:
one:
runs-on: ubuntu-latest
steps:
# .take in an issue comment.
- name: take an issue
uses: bdougie/take-action@main
env:
GITHUB_TOKEN: ${{ github.token }}
with:
message: Thanks for taking this on! If you have not already, join the conversation in our [Discord](https://discord.gg/U2peSNf23P)
message: Thanks for taking this on! If you have not already, join the conversation in our [Discord](https://discord.gg/U2peSNf23P)
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM node:16-alpine as development

WORKDIR /app

COPY package.json ./
COPY npm-shrinkwrap.json ./
COPY .npmrc ./
COPY .babelrc ./
COPY .eslintrc.yml ./

RUN npm ci

COPY config ./config
COPY scripts ./scripts
COPY public ./public
COPY src ./src

CMD [ "npm", "start"]

FROM development as builder

RUN npm run build

FROM nginx:1.21-alpine as production

COPY --from=builder /app/build /usr/share/nginx/html
20 changes: 0 additions & 20 deletions docs/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions docs/.npmrc

This file was deleted.

33 changes: 0 additions & 33 deletions docs/README.md

This file was deleted.

0 comments on commit df74d24

Please sign in to comment.