Skip to content

fix: buildkit in gh (#133) #90

fix: buildkit in gh (#133)

fix: buildkit in gh (#133) #90

name: 😎 PreProd
on:
workflow_dispatch:
push:
branches:
- "master"
- "main"
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref }}
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: "."
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 }}
kontinuous:
needs: [build-app]
name: "Deploy on Kubernetes 🐳"
uses: socialgouv/workflows/.github/workflows/use-ks-gh-preproduction-atlas.yaml@v1
secrets: inherit