Déploiement de l'app sur prod #36
Workflow file for this run
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
name: Déploiement à la demande de l'app | |
run-name: Déploiement de l'app sur ${{ github.event.inputs.target }} | |
on: | |
workflow_dispatch: | |
inputs: | |
target: | |
type: choice | |
description: Quel environnement ? | |
options: | |
- preprod | |
- prod | |
is-test-app: | |
type: boolean | |
description: Application de test | |
jobs: | |
build-app: | |
name: Build l'app | |
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 app image | |
run: > | |
earthly | |
--use-inline-cache --save-inline-cache --push | |
--platform=linux/amd64 | |
+app-build | |
--ENV_NAME=${{ github.event.inputs.target }} | |
--ANON_KEY=${{ secrets.ANON_KEY }} --API_URL=${{ secrets.API_URL }} | |
--SENTRY_DSN=${{ vars.SENTRY_DSN }} | |
--CRISP_WEBSITE_ID=${{ vars.CRISP_WEBSITE_ID }} | |
deploy-app: | |
name: Déploie l'app | |
if: ${{ github.event.inputs.is-test-app != 'true' }} | |
needs: build-app | |
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 | |
+app-deploy | |
--ENV_NAME=${{ github.event.inputs.target }} | |
--KOYEB_API_KEY=${{ secrets.KOYEB_API_KEY }} | |
deploy-test-app: | |
name: Déploie l'app de test | |
if: ${{ github.event.inputs.is-test-app == 'true' }} | |
needs: build-app | |
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 test app on Koyeb | |
run: > | |
earthly | |
--use-inline-cache | |
+app-deploy-test | |
--ENV_NAME=${{ github.event.inputs.target }} | |
--KOYEB_API_KEY=${{ secrets.KOYEB_API_KEY }} |