-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Benjamin PILIA <benjamin.pilia@protonmail.com>
- Loading branch information
1 parent
c8e56d1
commit 465e2eb
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Crée une image du frontend qui fonctionne avec un backend en local | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
type: environment | ||
description: Select the environment | ||
boolean: | ||
type: boolean | ||
description: True or False | ||
choice: | ||
type: choice | ||
description: Choisissez un environnement | ||
options: | ||
- local | ||
- dev | ||
- staging | ||
- prod | ||
|
||
|
||
env: | ||
IMAGE_NAME: ghcr.io/${{ github.repository }}/frontend | ||
IMAGE_TAG: ${{ github.sha }} | ||
|
||
jobs: | ||
build: | ||
if: contains(fromJson('["main", "staging", "dev"]'), github.ref_name) | ||
name: Build and push from ${{ github.ref_name }}/${{ github.sha }} | ||
environment: ${{ github.event.inputs.environment }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}-local,${{ env.IMAGE_NAME }}:${{github.ref_name}}-local | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
build-args: | | ||
VITE_API_URL=${{ vars.VITE_API_URL }} | ||
VITE_ENVIRONMENT_NAME=${{ vars.VITE_ENVIRONMENT_NAME }} | ||
VITE_MODEL_NAME=${{ vars.VITE_MODEL_NAME }} | ||
VITE_MODEL_MODE=${{ vars.VITE_MODEL_MODE }} | ||
VITE_MODEL_TEMPERATURE=${{ vars.VITE_MODEL_TEMPERATURE }} | ||
VITE_MATOMO_URL=${{ vars.VITE_MATOMO_URL }} |