Skip to content

Déploiement du site sur prod #142

Déploiement du site sur prod

Déploiement du site sur prod #142

Workflow file for this run

name: Déploiement à la demande du site
run-name: Déploiement du site sur ${{ github.event.inputs.target }}
on:
workflow_dispatch:
inputs:
target:
type: choice
description: Où déployer
options:
- preprod
- prod
jobs:
deploy-site:
name: Déploie le site
environment: ${{ github.event.inputs.target }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: earthly/actions/setup-earthly@v1
with:
version: v0.7.20
- name: Login into registry
run: earthly --use-inline-cache +docker-dev-login --GH_USER=${{ secrets.GH_USER }} --GH_TOKEN=${{ secrets.GH_TOKEN }}
- name: Build and push front deps image
run: >
earthly
--use-inline-cache --save-inline-cache --push
--platform=linux/amd64
+front-deps-builder
- name: Build and push site image
run: >
earthly
--use-inline-cache --save-inline-cache --push
--platform=linux/amd64
+site-build
--ENV_NAME=${{ github.event.inputs.target }}
--ANON_KEY=${{ secrets.ANON_KEY }} --API_URL=${{ secrets.API_URL }}
--STRAPI_KEY=${{ secrets.STRAPI_KEY }} --STRAPI_URL=${{ secrets.STRAPI_URL }}
--POSTHOG_HOST=${{ secrets.POSTHOG_HOST }} --POSTHOG_KEY=${{ secrets.POSTHOG_KEY }}
--AXEPTIO_ID=${{ vars.AXEPTIO_ID }}
- name: Deploy site on Koyeb
run: >
earthly
--use-inline-cache
+site-deploy
--ENV_NAME=${{ github.event.inputs.target }}
--KOYEB_API_KEY=${{ secrets.KOYEB_API_KEY }}