Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci-cd): production workflows #129

Merged
merged 3 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
workflow_call:
inputs:
node_env:
required: true
type:
ssh_hosts:
required: true
type: string
ssh_username:
Expand All @@ -19,6 +16,8 @@ on:
required: true
type: string
secrets:
ssh_hosts:
required: true
env_vars:
required: true
ssh_private_key:
Expand All @@ -29,7 +28,7 @@ jobs:
name: Pull and Run Docker Container
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(inputs.ssh_hosts) }}
matrix: ${{ fromJson(secrets.ssh_hosts) }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Development CI/CD

on:
pull_request_target:
types: [ opened, reopened, ready_for_review, labeled, synchronize ]
types: [ reopened, ready_for_review, labeled, synchronize ]

permissions:
actions: read
Expand All @@ -20,12 +20,14 @@ permissions:
jobs:
setup:
uses: Monday-Morning/project-reclamation/.github/workflows/setup.yml@main
runs-on: ubuntu-latest
with:
setup_dev: true

eslint:
needs: setup
uses: Monday-Morning/project-reclamation/.github/workflows/eslint.yml@main
runs-on: ubuntu-latest
with:
config_path: ./.eslintrc.yml
ignore_path: ./.eslintignore
Expand All @@ -34,6 +36,7 @@ jobs:
prettier:
needs: setup
uses: Monday-Morning/project-reclamation/.github/workflows/prettier.yml@main
runs-on: ubuntu-latest
with:
file_pattern: './server/.'
config_path: './.prettierrc.yml'
Expand All @@ -43,10 +46,12 @@ jobs:
mocha:
needs: [eslint, prettier]
uses: Monday-Morning/project-reclamation/.github/workflows/mocha.yml@main
if: contains(github.event.pull_request.labels.*.name, 'safe-for-checks')
runs-on: ubuntu-latest
if: join(github.event.pull_request.labels) != '' && contains(github.event.pull_request.labels.*.name, 'safe-for-checks')
with:
package_path: ./server/package.json

analyze:
needs: [eslint, prettier]
uses: Monday-Morning/project-reclamation/.github/workflows/analyze.yml@main
runs-on: ubuntu-latest
17 changes: 16 additions & 1 deletion .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,23 @@ on:
release:
types: [released]

permissions:
actions: write
checks: write
contents: write
deployments: write
issues: write
discussions: write
packages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write

jobs:
build:
uses: Monday-Morning/project-reclamation/.github/workflows/build.yml@main
runs-on: ubuntu-latest
with:
node_env: production
image_name: ${{ github.repository }}
Expand All @@ -20,12 +34,13 @@ jobs:
deploy:
needs: build
uses: Monday-Morning/project-reclamation/.github/workflows/deploy.yml@main
runs-on: ubuntu-latest
with:
node_env: production
ssh_hosts: ${{ secrets.SSH_HOSTS }}
ssh_username: mm
image_name: ${{ github.repository }}
registry: ghcr.io
secrets:
ssh_hosts: ${{ secrets.SSH_HOSTS }}
env_vars: ${{ secrets.PROD_ENV }}
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
6 changes: 6 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ permissions:
jobs:
setup:
uses: Monday-Morning/project-reclamation/.github/workflows/setup.yml@main
runs-on: ubuntu-latest
with:
setup_dev: true

eslint:
needs: setup
uses: Monday-Morning/project-reclamation/.github/workflows/eslint.yml@main
runs-on: ubuntu-latest
with:
config_path: ./.eslintrc.yml
ignore_path: ./.eslintignore
Expand All @@ -36,6 +38,7 @@ jobs:
prettier:
needs: setup
uses: Monday-Morning/project-reclamation/.github/workflows/prettier.yml@main
runs-on: ubuntu-latest
with:
file_pattern: './server/.'
config_path: './.prettierrc.yml'
Expand All @@ -45,16 +48,19 @@ jobs:
mocha:
needs: [eslint, prettier]
uses: Monday-Morning/project-reclamation/.github/workflows/mocha.yml@main
runs-on: ubuntu-latest
with:
package_path: ./server/package.json

analyze:
needs: [eslint, prettier]
uses: Monday-Morning/project-reclamation/.github/workflows/analyze.yml@main
runs-on: ubuntu-latest

build:
needs: [mocha, analyze]
uses: Monday-Morning/project-reclamation/.github/workflows/build.yml@main
runs-on: ubuntu-latest
with:
node_env: staging
image_name: ${{ github.repository }}
Expand Down