Skip to content

Commit 7781c4e

Browse files
committed
chore: update npm scripts to use npm instead of yarn
1 parent 6e91354 commit 7781c4e

File tree

5 files changed

+155
-3
lines changed

5 files changed

+155
-3
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# name: Deploy Digital Toolbox
2+
3+
# on:
4+
# push:
5+
# branches:
6+
# - main
7+
8+
# jobs:
9+
# deploy:
10+
# runs-on: ubuntu-latest
11+
12+
# steps:
13+
# - name: Checkout code
14+
# uses: actions/checkout@v2
15+
16+
# - name: Copy env files
17+
# run: cp .env.staging .env
18+
19+
# - name: Installing dependencies
20+
# run: npm install --legacy-peer-deps
21+
22+
# - name: Build the project
23+
# run: npm run build
24+
25+
# - name: Run the project
26+
# run: npm run serve
27+
28+
# # - name: Deploy to production
29+
# # run: |
30+
31+
# # Add your deployment command here
32+
# # For example, you can use a script or a specific command to deploy your project to production

.github/workflows/deploy-template.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# name: Build and Deploy
2+
3+
# on:
4+
# workflow_call:
5+
# inputs:
6+
# environment:
7+
# description: "Environment name"
8+
# required: true
9+
# type: string
10+
# containerNamespaceID:
11+
# description: "ScaleWay Container Namespace"
12+
# required: true
13+
# type: string
14+
# region:
15+
# description: "region name"
16+
# required: true
17+
# type: string
18+
# default: "fr-par"
19+
# projectId:
20+
# description: "project ID"
21+
# required: false
22+
# type: string
23+
# default: ""
24+
# appName:
25+
# description: "Application Name"
26+
# required: true
27+
# type: string
28+
29+
# jobs:
30+
# notify-start:
31+
# runs-on: ubuntu-latest
32+
# steps:
33+
# - name: Notify start on Slack
34+
# uses: rtCamp/action-slack-notify@v2
35+
# env:
36+
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
37+
# SLACK_MESSAGE: "Deployment to Scaleway Containers started! :eyes:"
38+
# SLACK_USERNAME: "Automation"
39+
# SLACK_ICON: ":rocket:"
40+
41+
# build-and-push:
42+
# name: Build and Push Docker Image
43+
# runs-on: ubuntu-latest
44+
# environment: ${{ inputs.environment }}
45+
# env:
46+
# REGION: ${{ inputs.region }}
47+
# REPOSITORY: rg.${{ inputs.region }}.scw.cloud/${{ inputs.appName }}
48+
# NAMESPACE: ${{ inputs.containerNamespaceID }}
49+
# PROJECT_ID: ${{ inputs.projectId }}
50+
# APP_NAME: ${{ inputs.appName }}
51+
52+
# steps:
53+
# - name: Checkout code
54+
# uses: actions/checkout@v2
55+
# - name: Overwrite .env file with .env.container
56+
# run: cp .env.container .env
57+
# - name: Login to Scaleway Container Registry
58+
# uses: docker/login-action@v3
59+
# with:
60+
# username: nologin
61+
# password: ${{ secrets.SCW_SECRET_KEY }}
62+
# registry: ${{ env.REPOSITORY }}
63+
# - name: Build the Docker image
64+
# run: docker build . -t ${{ env.REPOSITORY }}/dtb:latest
65+
# - name: Push the Docker Image
66+
# run: docker push ${{ env.REPOSITORY }}/dtb:latest
67+
68+
69+
# deploy:
70+
# runs-on: ubuntu-latest
71+
# name: Deploy on Scaleway Containers
72+
# needs: build-and-push
73+
# environment: ${{ inputs.environment }}
74+
# env:
75+
# REGION: ${{ inputs.region }}
76+
# REPOSITORY: rg.${{ inputs.region }}.scw.cloud/${{ inputs.appName }}
77+
# NAMESPACE: ${{ inputs.containerNamespaceID }}
78+
# PROJECT_ID: ${{ inputs.projectId }}
79+
# APP_NAME: ${{ inputs.appName }}
80+
# steps:
81+
# - name: Checkout
82+
# uses: actions/checkout@v3
83+
# - name: Scaleway Container Deploy action
84+
# id: deploy
85+
# uses: philibea/[email protected]
86+
# with:
87+
# type: deploy
88+
# scw_access_key: ${{ secrets.SCW_ACCESS_KEY }}
89+
# scw_secret_key: ${{ secrets.SCW_SECRET_KEY }}
90+
# scw_containers_namespace_id: ${{ env.NAMESPACE }}
91+
# scw_container_port: 3000
92+
# scw_registry: ${{ env.REPOSITORY }}/dtb:latest
93+
94+
# notify-success:
95+
# runs-on: ubuntu-latest
96+
# needs: [build-and-push, deploy]
97+
# if: success()
98+
# steps:
99+
# - name: Notify success on Slack
100+
# uses: rtCamp/action-slack-notify@v2
101+
# env:
102+
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
103+
# SLACK_MESSAGE: "Deployment to Scaleway Containers was successful! :tada:"
104+
# SLACK_USERNAME: "Automation"
105+
# SLACK_ICON: ":rocket:"
106+
107+
# notify-failure:
108+
# runs-on: ubuntu-latest
109+
# needs: [build-and-push, deploy]
110+
# if: failure()
111+
# steps:
112+
# - name: Notify failure on Slack
113+
# uses: rtCamp/action-slack-notify@v2
114+
# env:
115+
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
116+
# SLACK_MESSAGE: "Deployment to Scaleway Containers failed! :x:"
117+
# SLACK_USERNAME: "Automation"
118+
# SLACK_ICON: ":warning:"
119+

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ dist
33
/media
44
node_modules
55
.DS_Store
6-
.env
6+
# .env
77
.next
88
.vercel

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"build:payload": "cross-env PAYLOAD_CONFIG_PATH=src/payload/payload.config.ts payload build",
1212
"build:server": "tsc --project tsconfig.server.json",
1313
"build:next": "cross-env PAYLOAD_CONFIG_PATH=dist/payload/payload.config.js NEXT_BUILD=true node dist/server.js",
14-
"build": "cross-env NODE_ENV=production yarn build:payload && yarn build:server && yarn copyfiles && yarn build:next",
14+
"build": "cross-env NODE_ENV=production npm run build:payload && num run build:server && npm run copyfiles && npm run build:next",
1515
"serve": "cross-env PAYLOAD_CONFIG_PATH=dist/payload/payload.config.js NODE_ENV=production node dist/server.js",
16-
"eject": "yarn remove next react react-dom @next/eslint-plugin-next && ts-node eject.ts",
16+
"eject": "npm remove next react react-dom @next/eslint-plugin-next && ts-node eject.ts --force",
1717
"copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,js}\" dist/",
1818
"generate:types": "cross-env PAYLOAD_CONFIG_PATH=src/payload/payload.config.ts payload generate:types",
1919
"generate:graphQLSchema": "PAYLOAD_CONFIG_PATH=src/payload/payload.config.ts payload generate:graphQLSchema",

0 commit comments

Comments
 (0)