Basic case
(True story) react project deployment
#!/bin/bash
sed -i "s/ACCOUNT_ID/$(printenv CLOUDFLARE_ACCOUNT_ID)/" wrangler.toml
sed -i "s/ZONE_ID_STAGE/$(printenv CLOUDFLARE_ZONE_ID_STAGE)/" wrangler.toml
export CLOUDFLARE_API_KEY=$(printenv CLOUDFLARE_API_TOKEN)
export CLOUDFLARE_EMAIL=$(printenv CLOUDFLARE_EMAIL)
#!/bin/bash
yarn install --frozen-lockfile
#!/bin/bash
cp .env.stage .env
yarn build
#!/bin/bash
wrangler deploy --env=stage
version: '1.0'
from: 'romainlavabrefairfair/deploy-react'
steps:
- name: '@init-wrangler'
script: '/init-wrangler.sh'
- name: '@install'
script: '/install.sh'
- name: '@build'
script: '/build.sh'
- name: '@push'
script: '/push.sh'
This in about 50 repositories, then one fine day, we had enough of the slowness of yarn, and we cried, because we had to change 50 repositories. (Yes im stupid)
So, please, store your global script in your docker image (in /app)
And in your repository, you just have
version: '1.0'
from: 'romainlavabrefairfair/deploy-react'
steps:
- name: '@init-wrangler'
script: /init-wrangler.sh STAGE
- name: '@install'
script: /install.sh
- name: '@build'
script: /build.sh stage
- name: '@push'
script: /push.sh stage
And if you want to switch from yarn to npm, you just have to change your base image
Last updated