Skip to content

Commit

Permalink
Merge pull request #236 from dgrebb/develop
Browse files Browse the repository at this point in the history
Release 2.0.0
  • Loading branch information
dgrebb authored Jun 18, 2023
2 parents 0c609c3 + 460cb3f commit 4c3254b
Show file tree
Hide file tree
Showing 186 changed files with 9,703 additions and 9,294 deletions.
9 changes: 9 additions & 0 deletions .cz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"commitizen": {
"name": "cz_conventional_commits",
"version": "2.0.0",
"tag_format": "$major.$minor.$patch$prerelease",
"version_type": "semver",
"bump_message": "release $current_version \u2192 $new_version"
}
}
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/bugs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Bugs
about: the horror to fixeth
title: "[BUG] - "
labels: bug
assignees: dgrebb

---

**wot**

**steps**

**snaps**

**supplements**
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Feature
about: New Features
title: "[FEAT] - "
labels: enhancement
assignees: dgrebb

---

# Requirements

1.

# Implementation

1.

# Testing



# Snaps



# Supplementary
45 changes: 45 additions & 0 deletions .github/workflows/build-deploy-back.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build & Deploy Backend

on:
repository_dispatch:
types:
- Backend

jobs:
back:
name: Backend
runs-on: ubuntu-latest

environment:
name: ${{ github.ref == 'refs/heads/main' && 'prd' || 'stg' }}

steps:
- name: To Do
run: echo "Build the backend workflow"
# - name: (Optional) Local Docker Package Install
# if: ${{ env.ACT }}
# run: |
# apt-get update
# apt-get install -y wget curl unzip
# curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
# unzip awscliv2.zip
# ./aws/install

# - name: Add Masks
# run: |
# echo "::add-mask::${{ github.token }}"
# echo "::add-mask::${{ secrets.PUBLIC_API_URL }}"
# echo "::add-mask::${{ secrets.API_KEY }}"
# echo "::add-mask::${{ secrets.PUBLIC_SENTRY_DSN }}"
# echo "::add-mask::${{ secrets.PUBLIC_ENV }}"
# echo "::add-mask::${{ secrets.AWS_ACCESS_KEY_ID }}"
# echo "::add-mask::${{ secrets.AWS_SECRET_ACCESS_KEY }}"
# echo "::add-mask::${{ secrets.AWS_REGION }}"
# echo "::add-mask::${{ secrets.AWS_S3_BUCKET }}"

# - name: Checkout
# uses: actions/checkout@v3
# with:
# repository: dgrebb/dgrebb.com
# ref: ${{ secrets.DEPLOYMENT_BRANCH }}
# token: ${{ github.token }}
97 changes: 97 additions & 0 deletions .github/workflows/build-deploy-front.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Build & Deploy Frontend

on:
workflow_dispatch:
repository_dispatch:
types:
- Frontend
- Strapi

jobs:
front:
name: Frontend
runs-on: ubuntu-latest

environment:
name: ${{ github.ref == 'refs/heads/main' && 'prd' || 'stg' }}

steps:
- name: (Optional) Local Docker Package Install
if: ${{ env.ACT }}
run: |
apt-get update
apt-get install -y wget curl unzip
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
./aws/install
- name: Add Masks
run: |
echo "::add-mask::${{ github.token }}"
echo "::add-mask::${{ secrets.PUBLIC_API_PATH_NAVIGATION }}"
echo "::add-mask::${{ secrets.PUBLIC_API_URL }}"
echo "::add-mask::${{ secrets.PUBLIC_API_PATH_HOME }}"
echo "::add-mask::${{ secrets.PUBLIC_API_PATH_FOOTER }}"
echo "::add-mask::${{ secrets.API_KEY }}"
echo "::add-mask::${{ secrets.PUBLIC_SENTRY_DSN }}"
echo "::add-mask::${{ secrets.PUBLIC_ENV }}"
echo "::add-mask::${{ secrets.AWS_ACCESS_KEY_ID }}"
echo "::add-mask::${{ secrets.AWS_SECRET_ACCESS_KEY }}"
echo "::add-mask::${{ secrets.AWS_REGION }}"
echo "::add-mask::${{ secrets.AWS_S3_BUCKET }}"
- name: Checkout
uses: actions/checkout@v3
with:
repository: dgrebb/dgrebb.com
ref: ${{ secrets.DEPLOYMENT_BRANCH }}
token: ${{ github.token }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: "18.x"

- name: Set .env
run: |
touch front/.env
echo PUBLIC_MEDIA_URL='' >> front/.env
echo PUBLIC_API_URL='${{ secrets.PUBLIC_API_URL }}' >> front/.env
echo PUBLIC_API_PATH_NAVIGATION='${{ secrets.PUBLIC_API_PATH_NAVIGATION }}' >> front/.env
echo PUBLIC_API_PATH_HOME='${{ secrets.PUBLIC_API_PATH_HOME }}' >> front/.env
echo PUBLIC_API_PATH_FOOTER='${{ secrets.PUBLIC_API_PATH_FOOTER }}' >> front/.env
echo API_KEY=${{ secrets.API_KEY }} >> front/.env
echo PUBLIC_SENTRY_DSN=${{ secrets.PUBLIC_SENTRY_DSN }} >> front/.env
echo PUBLIC_ENV=${{ secrets.PUBLIC_ENV }} >> front/.env
cat front/.env
- name: Build
id: npm-build
env:
GH_TOKEN: ${{ github.token }}
run: bash _ci/build.sh

- name: Robots
if: ${{ github.ref == 'main' }}
run: |
sed -i 's/^Disallow\: \/$/Allow\: \//' front/build/robots.txt
- name: Deploy
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
SOURCE_DIR: "front/build"

- name: Invalidate CloudFront
uses: chetan/invalidate-cloudfront-action@v2
env:
DISTRIBUTION: ${{ secrets.DISTRIBUTION }}
PATHS: "/*"
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
61 changes: 61 additions & 0 deletions .github/workflows/dispatch-build-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Dispatch Build & Deploy

on:
push:
branches:
- main
- develop

jobs:
changes:
runs-on: ubuntu-latest
outputs:
backend: ${{ steps.changes.outputs.backend }}
frontend: ${{ steps.changes.outputs.frontend }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: changes
with:
base: ${{ secrets.DEPLOYMENT_BRANCH }}
filters: |
backend:
- 'back/**'
frontend:
- 'front/**'
# backend:
# needs: changes
# if: ${{ needs.changes.outputs.backend == 'true' }}
# runs-on: ubuntu-latest

# steps:

# - name: Add Masks
# run: |
# echo "::add-mask::${{ secrets.DISPATCH_TOKEN }}"

# - name: Dispatch Backend
# run: |
# curl -X POST https://api.github.com/repos/dgrebb/dgrebb.com/dispatches \
# -H 'Accept: application/vnd.github.everest-preview+json' \
# -H 'Authorization: Bearer ${{ secrets.DISPATCH_TOKEN }}' \
# --data '{"event_type": "Backend"}'

frontend:
needs: changes
if: ${{ needs.changes.outputs.frontend == 'true' }}
runs-on: ubuntu-latest

steps:

- name: Add Masks
run: |
echo "::add-mask::${{ secrets.DISPATCH_TOKEN }}"
- name: Dispatch Frontend
run: |
curl -X POST https://api.github.com/repos/dgrebb/dgrebb.com/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-H 'Authorization: Bearer ${{ secrets.DISPATCH_TOKEN }}' \
--data '{"event_type": "Frontend"}'
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,10 @@ build

# Crash log files
crash.log
crash.*.log
crash.*.log

############################
# Commitizen
############################

.cz.toml
Loading

0 comments on commit 4c3254b

Please sign in to comment.