Skip to content

Commit

Permalink
Merge pull request #1 from include-davis/feat/cicd
Browse files Browse the repository at this point in the history
Feat/cicd
  • Loading branch information
Austin2Shih authored Mar 16, 2024
2 parents c9f9c67 + 6df005a commit 216d1f3
Show file tree
Hide file tree
Showing 42 changed files with 17,910 additions and 25,782 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
58 changes: 58 additions & 0 deletions .github/workflows/production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Production Deployment

on:
release:
types: [published]

jobs:
deploy_staging:
name: Deploy Production
runs-on: ubuntu-latest
environment:
name: production
url: ${{ vars.ENV_URL }}

env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
HOST: 0.0.0.0
ADMIN_JWT_SECRET: ${{ secrets.ADMIN_JWT_SECRET }}
API_TOKEN_SALT: ${{ secrets.API_TOKEN_SALT }}
APP_KEYS: ${{ secrets.APP_KEYS }}
CLOUDINARY_KEY: ${{ secrets.CLOUDINARY_KEY }}
CLOUDINARY_NAME: ${{ secrets.CLOUDINARY_NAME }}
TRANSFER_TOKEN_SALT: ${{ secrets.TRANSFER_TOKEN_SALT }}
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
DATABASE_USERNAME: ${{ secrets.DATABASE_USERNAME }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
TOKEN_TRANSFER_SALT: ${{ secrets.TOKEN_TRANSFER_SALT }}
DATABASE_HOST: ${{ vars.DATABASE_HOST }}
DATABASE_NAME: ${{ vars.DATABASE_NAME }}
DATABASE_PORT: ${{ vars.DATABASE_PORT }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install node
uses: actions/setup-node@v4
with:
node-version: '20.11.1'

- name: Install dependencies
run: npm install

- name: Install railway
run: npm install -g @railway/[email protected]

- name: Build Strapi
run: npm run build

- name: Deploy image to Railway
run: >
RAILWAY_TOKEN=${{ secrets.RAILWAY_TOKEN }}
railway up
--service "strapi"
-d
- name: Success
run: echo "🚀 Deploy successful 🚀 "
File renamed without changes.
58 changes: 57 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,57 @@
# paul-hom-cms
# 🚀 Getting started with Strapi

Strapi comes with a full featured [Command Line Interface](https://docs.strapi.io/dev-docs/cli) (CLI) which lets you scaffold and manage your project in seconds.

### `develop`

Start your Strapi application with autoReload enabled. [Learn more](https://docs.strapi.io/dev-docs/cli#strapi-develop)

```
npm run develop
# or
yarn develop
```

### `start`

Start your Strapi application with autoReload disabled. [Learn more](https://docs.strapi.io/dev-docs/cli#strapi-start)

```
npm run start
# or
yarn start
```

### `build`

Build your admin panel. [Learn more](https://docs.strapi.io/dev-docs/cli#strapi-build)

```
npm run build
# or
yarn build
```

## ⚙️ Deployment

Strapi gives you many possible deployment options for your project including [Strapi Cloud](https://cloud.strapi.io). Browse the [deployment section of the documentation](https://docs.strapi.io/dev-docs/deployment) to find the best solution for your use case.

## 📚 Learn more

- [Resource center](https://strapi.io/resource-center) - Strapi resource center.
- [Strapi documentation](https://docs.strapi.io) - Official Strapi documentation.
- [Strapi tutorials](https://strapi.io/tutorials) - List of tutorials made by the core team and the community.
- [Strapi blog](https://strapi.io/blog) - Official Strapi blog containing articles made by the Strapi team and the community.
- [Changelog](https://strapi.io/changelog) - Find out about the Strapi product updates, new features and general improvements.

Feel free to check out the [Strapi GitHub repository](https://github.com/strapi/strapi). Your feedback and contributions are welcome!

## ✨ Community

- [Discord](https://discord.strapi.io) - Come chat with the Strapi community including the core team.
- [Forum](https://forum.strapi.io/) - Place to discuss, ask questions and find answers, show your Strapi project and get feedback or just talk with other Community members.
- [Awesome Strapi](https://github.com/strapi/awesome-strapi) - A curated list of awesome things related to Strapi.

---

<sub>🤫 Psst! [Strapi is hiring](https://strapi.io/careers).</sub>
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions config/database.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// strapi-api/config/database.js
module.exports = ({ env }) => ({
connection: {
client: 'postgres',
connection: {
host: env('DATABASE_HOST', 'localhost'),
port: env.int('DATABASE_PORT', 5432),
database: env('DATABASE_NAME', 'railway'),
user: env('DATABASE_USERNAME', 'postgres'),
password: env('DATABASE_PASSWORD', '0000'),
schema: env('DATABASE_SCHEMA', 'public'), // Not required
ssl: {
rejectUnauthorized: env.bool('DATABASE_SSL_SELF', false),
},
},
debug: false,
},
});
25 changes: 25 additions & 0 deletions config/middlewares.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = [
'strapi::errors',
{
name: 'strapi::security',
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'", 'https:'],
'img-src': ["'self'", 'data:', 'blob:', 'res.cloudinary.com'],
'media-src': ["'self'", 'data:', 'blob:', 'res.cloudinary.com'],
upgradeInsecureRequests: null,
},
},
},
},
'strapi::cors',
'strapi::poweredBy',
'strapi::logger',
'strapi::query',
'strapi::body',
'strapi::session',
'strapi::favicon',
'strapi::public',
];
18 changes: 18 additions & 0 deletions config/plugins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = ({ env }) => ({
// ...
upload: {
config: {
provider: 'cloudinary',
providerOptions: {
cloud_name: env('CLOUDINARY_NAME'),
api_key: env('CLOUDINARY_KEY'),
api_secret: env('CLOUDINARY_SECRET'),
},
actionOptions: {
upload: {},
delete: {},
},
},
},
// ...
});
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
Loading

0 comments on commit 216d1f3

Please sign in to comment.