Compare commits

...

18 Commits
cicd ... main

Author SHA1 Message Date
3048e8788e Merge pull request 'legacy_preprod' (#11) from legacy_preprod into main
All checks were successful
Prod - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Successful in 11s
Prod - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Successful in 3s
Reviewed-on: #11
2025-07-17 20:09:57 +00:00
67fa4c923d Change ci event to push 2025-07-17 20:07:04 +00:00
a916a66747 Actualiser .github/workflows/demo.yml 2025-07-17 20:04:06 +00:00
a8f2d8ed75 Merge pull request 'legacy_preprod' (#10) from legacy_preprod into main
All checks were successful
Demo - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Successful in 13s
Demo - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Successful in 5s
Prod - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Successful in 14s
Prod - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Successful in 3s
Reviewed-on: #10
2025-07-16 14:58:56 +00:00
omaroughriss
1621bc1d53 Merge branch 'cicd' into legacy_dev 2025-07-16 16:43:27 +02:00
affa234d65 revert 3ba6dd767d2257056fbf5f29cfa27c9311701cdd
All checks were successful
Demo - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Successful in 14s
Demo - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Successful in 4s
revert Add conditions to use only the schedule event
2025-07-16 11:22:16 +00:00
a0ac83bf2f revert 36e1bae353cb973b2f7c63f29ea8d433f6fc54f2
All checks were successful
Demo - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Has been skipped
Demo - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Has been skipped
revert Add schedule to the demo cicd
2025-07-16 11:18:25 +00:00
omaroughriss
3ba6dd767d Add conditions to use only the schedule event
All checks were successful
Demo - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Has been skipped
Demo - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Has been skipped
2025-07-16 12:55:41 +02:00
omaroughriss
36e1bae353 Add schedule to the demo cicd
All checks were successful
Demo - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Successful in 12s
Demo - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Successful in 4s
2025-07-16 12:30:20 +02:00
c313f6b493 Actualiser .github/workflows/test.yml
Some checks failed
Prod - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Successful in 13s
Prod - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Successful in 4s
Test - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Successful in 17s
Test - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Failing after 4s
2025-06-20 10:21:06 +00:00
ddf6c6c79d Ajouter .github/workflows/test.yml
All checks were successful
Prod - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Successful in 16s
Prod - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Successful in 5s
2025-06-20 10:17:33 +00:00
b632729796 Actualiser package.json
All checks were successful
Prod - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Successful in 1m58s
Prod - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Successful in 4s
Preprod - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Successful in 18s
Preprod - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Successful in 4s
2025-06-17 14:27:23 +00:00
ece4738b44 Actualiser .github/workflows/prd.yml
All checks were successful
Prod - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Successful in 14s
Prod - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Successful in 7s
2025-06-17 13:40:49 +00:00
21ea67e1c1 Actualiser package.json
All checks were successful
Prod - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Successful in 3m29s
Prod - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Successful in 7s
2025-06-17 13:25:57 +00:00
ef4f8ac2bc Actualiser package.json
Some checks failed
Prod - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Failing after 55s
Prod - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Has been skipped
2025-06-17 13:24:09 +00:00
05ffd14447 Actualiser Dockerfile
Some checks failed
Prod - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Failing after 24s
Prod - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Has been skipped
2025-06-17 13:21:33 +00:00
ae047c9485 Actualiser package.json
Some checks failed
Prod - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Failing after 29s
Prod - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Has been skipped
2025-06-17 13:15:01 +00:00
b94037e4a5 Actualiser package.json
Some checks failed
Prod - Build & Deploy to Scaleway / build-and-push-image-lecoffre (push) Failing after 29s
Prod - Build & Deploy to Scaleway / deploy-to-scaleway-lecoffre (push) Has been skipped
2025-06-17 13:12:03 +00:00
4 changed files with 96 additions and 18 deletions

View File

@ -1,8 +1,8 @@
name: Demo - Build & Deploy to Scaleway
on:
schedule:
- cron: '00 15 * * *' # 15:00 UTC -> 17:00 CEST
push:
- [legacy_dev]
env:
PROJECT_ID_LECOFFRE: 72d08499-37c2-412b-877e-f8af0471654a

View File

@ -1,8 +1,8 @@
name: Prod - Build & Deploy to Scaleway
on:
schedule:
- cron: '00 20 * * *' # 20:00 UTC -> 22:00 CEST
push:
branches: [main]
env:
@ -18,16 +18,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Copy SSH
run: cp ~/.ssh/id_rsa id_rsa
#- name: Setup SSH
# run: |
# mkdir -p ~/.ssh
# echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
# chmod 600 ~/.ssh/id_rsa
# ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
# env:
# SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
#- name: Copy SSH
# run: cp ~/.ssh/id_rsa id_rsa
- name: Login to Scaleway Container Registry
uses: docker/login-action@v3
with:

78
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,78 @@
name: Test - Build & Deploy to Scaleway
on:
push:
branches: [test]
env:
PROJECT_ID_LECOFFRE: 72d08499-37c2-412b-877e-f8af0471654a
NAMESPACE_ID_LECOFFRE: e2036b1d-b5c1-4cdd-b168-d895c498f679
CONTAINER_REGISTRY_ENDPOINT_LECOFFRE: rg.fr-par.scw.cloud/funcscwlecoffretestfhhn6rcl
IMAGE_NAME: front
CONTAINER_NAME: front
jobs:
build-and-push-image-lecoffre:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Copy SSH
run: cp ~/.ssh/id_rsa id_rsa
- name: Login to Scaleway Container Registry
uses: docker/login-action@v3
with:
username: nologin
password: ${{ secrets.SCW_SECRET_KEY_LECOFFRE }}
registry: ${{ env.CONTAINER_REGISTRY_ENDPOINT_LECOFFRE }}
- name: Get Git Commit SHA
id: vars
run: echo "COMMIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Build the Docker Image
run: docker build . -t ${{ env.CONTAINER_REGISTRY_ENDPOINT_LECOFFRE }}/${{ env.IMAGE_NAME }}
- name: Push the Docker Image to Scaleway Container Registry
run: docker push ${{ env.CONTAINER_REGISTRY_ENDPOINT_LECOFFRE }}/${{ env.IMAGE_NAME }}
deploy-to-scaleway-lecoffre:
needs: build-and-push-image-lecoffre
runs-on: ubuntu-latest
environment: preprod
steps:
- name: Install CLI
uses: scaleway/action-scw@v0
- name: Get container ID
run: |
echo "CONTAINER_ID=$(scw container container list namespace-id=${{env.NAMESPACE_ID_LECOFFRE}} -o json | jq -r '.[] | select(.name == "${{ env.CONTAINER_NAME }}") | .id')" >> $GITHUB_ENV
env:
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY_LECOFFRE }}
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY_LECOFFRE }}
SCW_DEFAULT_PROJECT_ID: ${{ env.PROJECT_ID_LECOFFRE }}
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID_LECOFFRE }}
- name: Deploy the container based on the new image
run: |
env_string=""
while IFS= read -r line; do
if [[ "$line" == *"="* ]]; then
key=$(echo "$line" | cut -d '=' -f 1)
value=$(echo "$line" | cut -d '=' -f 2-)
if [[ -n "$key" ]]; then
env_string+="environment-variables.$key=$value "
fi
fi
done <<< "$ENV_VARS"
env_string=$(echo $env_string | sed 's/ $//')
scw container container update ${{ env.CONTAINER_ID }} $env_string
env:
ENV_VARS: ${{ secrets.ENV }}
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY_LECOFFRE }}
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY_LECOFFRE }}
SCW_DEFAULT_PROJECT_ID: ${{ env.PROJECT_ID_LECOFFRE }}
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID_LECOFFRE }}

View File

@ -7,10 +7,10 @@ COPY package.json ./
RUN apk update && apk add openssh-client git
COPY id_rsa /root/.ssh/id_rsa
RUN chmod 600 ~/.ssh/id_rsa
RUN eval "$(ssh-agent -s)" && ssh-add /root/.ssh/id_rsa
RUN ssh-keyscan github.com smart-chain-fr/leCoffre-resources.git >> /root/.ssh/known_hosts
#COPY id_rsa /root/.ssh/id_rsa
#RUN chmod 600 ~/.ssh/id_rsa
#RUN eval "$(ssh-agent -s)" && ssh-add /root/.ssh/id_rsa
#RUN ssh-keyscan github.com smart-chain-fr/leCoffre-resources.git >> /root/.ssh/known_hosts
RUN npm install --frozen-lockfile