Skip to content

Déploiement du backend sur preprod #2

Déploiement du backend sur preprod

Déploiement du backend sur preprod #2

Workflow file for this run

name: Déploiement à la demande du backend
run-name: Déploiement du backend sur ${{ github.event.inputs.target }}
on:
workflow_dispatch:
inputs:
target:
type: choice
description: Quel environnement ?
options:
- preprod
- prod
jobs:
build-backend:
name: Build le backend
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 backend image
run: >
earthly
--use-inline-cache --save-inline-cache --push
--platform=linux/amd64
+backend-build
--ENV_NAME=${{ github.event.inputs.target }}
deploy-backend:
name: Déploie le backend
needs: build-backend
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: Deploy app on Koyeb
run: >
earthly
--use-inline-cache
+backend-deploy
--ENV_NAME=${{ github.event.inputs.target }}
--KOYEB_API_KEY=${{ secrets.KOYEB_API_KEY }}