diff --git a/.github/workflows/deactivate.yaml b/.github/workflows/deactivate.yaml index 9f6e3e230..100f0a7a5 100644 --- a/.github/workflows/deactivate.yaml +++ b/.github/workflows/deactivate.yaml @@ -18,6 +18,7 @@ on: - "!**-persist-**" jobs: - socialgouv: - uses: socialgouv/workflows/.github/workflows/use-ks-gh-deactivate.yaml@v1 + kontinuous: + name: "Deploy on Kubernetes 🐳" + uses: socialgouv/workflows/.github/workflows/use-ks-gh-deactivate-atlas.yaml@v1 secrets: inherit diff --git a/.github/workflows/preproduction.yaml b/.github/workflows/preproduction.yaml index 0515cfad1..27cf4a67a 100644 --- a/.github/workflows/preproduction.yaml +++ b/.github/workflows/preproduction.yaml @@ -1,17 +1,51 @@ -#name: 😎 PreProd -#on: -# workflow_dispatch: -# push: -# branches: -# - "master" -# - "main" +name: 😎 PreProd +on: + workflow_dispatch: + push: + branches: + - "master" + - "main" -#concurrency: -# cancel-in-progress: true -# group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref }} +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref }} -#jobs: -# socialgouv: -# name: "🇫🇷 SocialGouv" -# uses: socialgouv/workflows/.github/workflows/use-ks-gh-preproduction.yaml@v1 -# secrets: inherit +jobs: + build-app: + environment: build-preproduction + 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=sha,prefix=preprod-,format=long,priority=850 + type=sha,prefix=sha-,format=long,priority=890 + + - name: 📦 Build and push Docker image for app + uses: socialgouv/workflows/actions/buildkit@v1 + with: + context: "./api" + 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 }} + + kontinuous: + needs: [build-app] + name: "Deploy on Kubernetes 🐳" + uses: socialgouv/workflows/.github/workflows/use-ks-gh-preproduction-atlas.yaml@v1 + secrets: inherit diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml index 3cae2d52a..f3c7397d3 100644 --- a/.github/workflows/production.yaml +++ b/.github/workflows/production.yaml @@ -10,7 +10,42 @@ concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref }} jobs: - socialgouv: - name: "🇫🇷 SocialGouv" - uses: socialgouv/workflows/.github/workflows/use-ks-gh-production.yaml@v1 + 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: "./api" + 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 }} + + kontinuous: + needs: [build-app] + name: "Deploy on Kubernetes 🐳" + uses: socialgouv/workflows/.github/workflows/use-ks-gh-production-atlas.yaml@v1 secrets: inherit diff --git a/.github/workflows/review-auto.yaml b/.github/workflows/review-auto.yaml index 548cf4e01..a3da7cea8 100644 --- a/.github/workflows/review-auto.yaml +++ b/.github/workflows/review-auto.yaml @@ -10,7 +10,48 @@ concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref }} jobs: - socialgouv: - name: "🇫🇷 SocialGouv" - uses: socialgouv/workflows/.github/workflows/use-ks-gh-review-auto.yaml@v1 + build-app: + environment: build-review-auto + 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=sha,prefix=persist-,format=long,enable=${{ + github.ref_name == 'dev' || + github.ref_name == 'develop' || + github.ref_name == 'preprod' || + github.ref_name == 'main' || + github.ref_name == 'master' + }},priority=840 + type=sha,prefix=sha-,format=long,priority=890 + type=ref,event=branch,priority=600 + + - name: 📦 Build and push Docker image for app + uses: socialgouv/workflows/actions/buildkit@v1 + with: + context: "./api" + 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 }} + + kontinuous: + needs: [build-app] + name: "Deploy on Kubernetes 🐳" + uses: socialgouv/workflows/.github/workflows/use-ks-gh-review-auto-atlas.yaml@v1 secrets: inherit diff --git a/.github/workflows/review.yaml b/.github/workflows/review.yaml index 258abaf35..97698024a 100644 --- a/.github/workflows/review.yaml +++ b/.github/workflows/review.yaml @@ -13,7 +13,48 @@ concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref }} jobs: - socialgouv: - name: "🇫🇷 SocialGouv" - uses: socialgouv/workflows/.github/workflows/use-ks-gh-review.yaml@v1 + build-app: + environment: build-review + 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=sha,prefix=persist-,format=long,enable=${{ + github.ref_name == 'dev' || + github.ref_name == 'develop' || + github.ref_name == 'preprod' || + github.ref_name == 'main' || + github.ref_name == 'master' + }},priority=840 + type=sha,prefix=sha-,format=long,priority=890 + type=ref,event=branch,priority=600 + + - name: 📦 Build and push Docker image for app + uses: socialgouv/workflows/actions/buildkit@v1 + with: + context: "./api" + 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 }} + + kontinuous: + needs: [build-app] + name: "Deploy on Kubernetes 🐳" + uses: socialgouv/workflows/.github/workflows/use-ks-gh-review-atlas.yaml@v1 secrets: inherit diff --git a/.kontinuous/values.yaml b/.kontinuous/values.yaml index 3c06e8e79..5707a4ae5 100644 --- a/.kontinuous/values.yaml +++ b/.kontinuous/values.yaml @@ -1,7 +1,7 @@ # yaml-language-server: $schema=../../kontinuous/docs/values.schema.json app: - ~needs: [build-app, pg] + ~needs: [pg] containerPort: 3000 probesPath: /healthz envFrom: @@ -12,9 +12,3 @@ app: pg: ~chart: pg - -jobs: - runs: - build-app: - with: - context: api diff --git a/.socialgouv.yaml b/.socialgouv.yaml deleted file mode 100644 index e69de29bb..000000000