ebs/.github/workflows/cd.yml
Thomas SAMSON c2b3d30640
Staging (#63)
* Add/preprod (#61)

* Enable preprod and cd on pr

* Replace bitnami psql with CNPG

* Update env name

* Fix build

* fix CVE-2026-27135

* Fix main condition

* add cleanup

* purge old vars

* Set vars for build

* Add PG_PWD for CNPG

* Fix CVE for caddy

* Fix caddy build

* Fix environment name

* Fix namespace

* fix domain

* Add nonprod domain

* Fix sharded buffer

* Fix secret

* Revert secret

* grant creat db for fixture

---------

Co-authored-by: ThomasSamson <thomas@samson-pro.fr>

* Update storage bucket variables for production and nonprod

* fix nonprod trusted host

---------

Co-authored-by: ThomasSamson <thomas@samson-pro.fr>
2026-05-05 13:32:03 +02:00

50 lines
1.5 KiB
YAML

name: CD
on:
push:
branches:
- main
- staging
pull_request:
types: [ opened, reopened, synchronize, labeled ]
workflow_dispatch: ~
permissions:
pull-requests: write
id-token: write
contents: read
packages: write
jobs:
remove-deploy-label:
name: Remove deploy label
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy')
runs-on: ubuntu-latest
steps:
- uses: mondeja/remove-labels-gh-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
deploy
build:
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy'))
name: Build
uses: ./.github/workflows/build.yml
deploy:
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy'))
name: Deploy
needs: [ build ]
uses: ./.github/workflows/deploy.yml
concurrency: ${{ github.ref }}-deploy
secrets:
domain: ${{ secrets.DOMAIN }}
payum-apikey: ${{ secrets.PAYUM_APIKEY }}
storage-key: ${{ secrets.STORAGE_KEY }}
storage-secret-key: ${{ secrets.STORAGE_SECRET_KEY}}
project-id: ${{ secrets.PROJECT_ID }}
workload-identity-provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
pg-password: ${{ secrets.PG_PASSWORD }}
mailer-dsn: ${{ secrets.MAILER_DSN }}
sms-dsn: ${{ secrets.SMS_DSN }}