-
Notifications
You must be signed in to change notification settings - Fork 28
74 lines (69 loc) · 2.99 KB
/
production.yaml
File metadata and controls
74 lines (69 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: 🚀 Production
on:
workflow_dispatch:
push:
tags:
- v*
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref }}
jobs:
build-app:
environment: build-production
outputs:
tags: ${{ steps.meta.outputs.tags }}
runs-on: ubuntu-latest
steps:
- name: ⏬ Checkout code repository
uses: actions/checkout@v4
- name: 📌 Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ vars.REGISTRY_URL }}/${{ vars.PROJECT_NAME }}/${{ github.event.repository.name }}/app
tags: |
type=semver,pattern=v{{version}},priority=900
type=sha,prefix=sha-,format=long,priority=890
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }},priority=200
- name: 📦 Build and push Docker image for app
uses: socialgouv/workflows/actions/buildkit@v1
with:
context: "."
dockerfile: "Dockerfile"
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
registry: "${{ vars.REGISTRY_URL }}"
registry-username: "${{ secrets.REGISTRY_USERNAME }}"
registry-password: "${{ secrets.REGISTRY_PASSWORD }}"
buildkit-cert-ca: "${{ secrets.BUILDKIT_CERT_CA }}"
buildkit-cert: "${{ secrets.BUILDKIT_CERT }}"
buildkit-cert-key: "${{ secrets.BUILDKIT_CERT_KEY }}"
buildkit-svc-count: ${{ vars.BUILDKIT_SVC_COUNT }}
buildkit-daemon-address: ${{ vars.BUILDKIT_DAEMON_ADDRESS }}
secrets: |
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
ELASTICSEARCH_TOKEN_API=${{ secrets.ELASTICSEARCH_TOKEN_API }}
ELASTICSEARCH_URL=${{ secrets.ELASTICSEARCH_URL }}
build-args: |
NEXT_PUBLIC_CDTN_ENV=production
NEXT_PUBLIC_IS_PRODUCTION_DEPLOYMENT=true
NEXT_PUBLIC_BUCKET_FOLDER=published
NEXT_PUBLIC_BUCKET_SITEMAP_FOLDER=sitemap
NEXT_PUBLIC_BUCKET_URL=https://cdtn-prod-public.s3.gra.io.cloud.ovh.net
NEXT_PUBLIC_PIWIK_SITE_ID=4
NEXT_PUBLIC_PIWIK_URL=https://matomo.fabrique.social.gouv.fr
NEXT_PUBLIC_COMMIT=${{ github.sha }}
NEXT_PUBLIC_SITE_URL=https://code.travail.gouv.fr
NEXT_PUBLIC_SENTRY_DSN=${{ secrets.PUBLIC_SENTRY_DSN }}
NEXT_PUBLIC_SENTRY_ENV=production
NEXT_PUBLIC_ES_INDEX_PREFIX=cdtn-prod
SENTRY_RELEASE=${{ github.ref_name }}
SENTRY_ORG=incubateur
SENTRY_PROJECT=fabnum-code-du-travail-numerique
SENTRY_URL=https://sentry2.fabrique.social.gouv.fr
NEXT_PUBLIC_ENABLE_AB_TESTING=false
kontinuous:
needs: [build-app]
name: "Deploy on Kubernetes 🐳"
uses: socialgouv/workflows/.github/workflows/use-ks-gh-production-atlas.yaml@v1
secrets: inherit