Skip to content

Commit

Permalink
Simplification des CDs
Browse files Browse the repository at this point in the history
  • Loading branch information
NerOcrO committed Jul 24, 2024
1 parent 5121785 commit 9d9f89a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 92 deletions.
39 changes: 7 additions & 32 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,50 +29,25 @@ jobs:
key: node_modules.-${{ hashFiles('package-lock.json') }}
path: node_modules

build:
needs: dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Retrieve cached dependencies
uses: actions/cache@v4
with:
key: node_modules-${{ hashFiles('package-lock.json') }}
path: node_modules
- name: Override .env
uses: SpicyPizza/[email protected]
with:
envkey_VITE_APP_API: ${{ secrets.REACT_APP_API_DEMO }}
envkey_VITE_APP_PIX_CAMPAGNE_URL: ${{ secrets.REACT_APP_PIX_CAMPAGNE_URL }}
file_name: .env
- name: copy robots.txt
uses: canastro/copy-file-action@master
with:
source: "desindexation/robots.txt"
target: "public/robots.txt"
- name: Build application
run: npm run build
- name: copy .htaccess
- name: Copy robots.txt
uses: canastro/copy-file-action@master
with:
source: ".htaccess"
target: "dist/.htaccess"
- name: Upload release bundle as artifact
uses: actions/upload-artifact@v4
source: desindexation/robots.txt
target: dist/robots.txt
- name: Copy .htaccess
uses: canastro/copy-file-action@master
with:
name: bundle
path: dist/*
source: .htaccess
target: dist/.htaccess

deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Retrieve bundle React
uses: actions/download-artifact@v4
with:
name: bundle
path: dist
- name: Deploy on clever cloud
uses: s0/git-publish-subdir-action@develop
env:
Expand Down
31 changes: 3 additions & 28 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@ jobs:
key: node_modules.-${{ hashFiles('package-lock.json') }}
path: node_modules

build:
needs: dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Retrieve cached dependencies
uses: actions/cache@v4
with:
key: node_modules-${{ hashFiles('package-lock.json') }}
path: node_modules
- name: Override .env
uses: SpicyPizza/[email protected]
with:
Expand All @@ -47,27 +37,12 @@ jobs:
file_name: .env
- name: Build application
run: npm run build
- name: copy .htaccess
- name: Copy .htaccess
uses: canastro/copy-file-action@master
with:
source: ".htaccess"
target: "dist/.htaccess"
- name: Upload release bundle as artifact
uses: actions/upload-artifact@v4
with:
name: bundle
path: dist/*
source: .htaccess
target: dist/.htaccess

deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Retrieve bundle React
uses: actions/download-artifact@v4
with:
name: bundle
path: dist
- name: Deploy on clever cloud
uses: s0/git-publish-subdir-action@develop
env:
Expand Down
39 changes: 7 additions & 32 deletions .github/workflows/deploy-recette.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,50 +29,25 @@ jobs:
key: node_modules.-${{ hashFiles('package-lock.json') }}
path: node_modules

build:
needs: dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Retrieve cached dependencies
uses: actions/cache@v4
with:
key: node_modules-${{ hashFiles('package-lock.json') }}
path: node_modules
- name: Override .env
uses: SpicyPizza/[email protected]
with:
envkey_VITE_APP_API: ${{ secrets.REACT_APP_API_RECETTE }}
envkey_VITE_APP_PIX_CAMPAGNE_URL: ${{ secrets.REACT_APP_PIX_CAMPAGNE_URL }}
file_name: .env
- name: copy robots.txt
uses: canastro/copy-file-action@master
with:
source: "desindexation/robots.txt"
target: "public/robots.txt"
- name: Build application
run: npm run build
- name: copy .htaccess
- name: Copy robots.txt
uses: canastro/copy-file-action@master
with:
source: ".htaccess"
target: "dist/.htaccess"
- name: Upload release bundle as artifact
uses: actions/upload-artifact@v4
source: desindexation/robots.txt
target: dist/robots.txt
- name: Copy .htaccess
uses: canastro/copy-file-action@master
with:
name: bundle
path: dist/*
source: .htaccess
target: dist/.htaccess

deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Retrieve bundle React
uses: actions/download-artifact@v4
with:
name: bundle
path: dist
- name: Deploy on clever cloud
uses: s0/git-publish-subdir-action@develop
env:
Expand Down

0 comments on commit 9d9f89a

Please sign in to comment.