Déploiement de l'api d'automatisation technique sur prod #5
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'api d'automatisation technique | |
run-name: Déploiement de l'api d'automatisation technique sur ${{ github.event.inputs.target }} | |
on: | |
workflow_dispatch: | |
inputs: | |
target: | |
type: choice | |
description: Quel environnement ? | |
options: | |
- preprod | |
- prod | |
jobs: | |
build-tools-automation-api: | |
name: Build l'api d'automatisation technique | |
environment: ${{ github.event.inputs.target }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: earthly/actions-setup@v1 | |
with: | |
github-token: ${{ secrets.GH_TOKEN }} | |
version: ^0.8.0 | |
- name: Login into registry | |
run: docker login ghcr.io/territoiresentransitions --username "${{ secrets.GH_USER }}" --password "${{ secrets.GH_TOKEN }}" | |
- name: Build and push tools-automation-api image | |
run: > | |
earthly | |
--use-inline-cache --save-inline-cache --push | |
--platform=linux/amd64 | |
+tools-automation-api-docker | |
--ENV_NAME=${{ github.event.inputs.target }} | |
deploy-tools-automation-api: | |
name: Déploie l'api d'automatisation technique | |
needs: build-tools-automation-api | |
environment: ${{ github.event.inputs.target }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: earthly/actions-setup@v1 | |
with: | |
github-token: ${{ secrets.GH_TOKEN }} | |
version: ^0.8.0 | |
- name: Login into registry | |
run: docker login ghcr.io/territoiresentransitions --username "${{ secrets.GH_USER }}" --password "${{ secrets.GH_TOKEN }}" | |
- name: Deploy tools-automation-api on Koyeb | |
run: > | |
earthly | |
--use-inline-cache --save-inline-cache | |
+tools-automation-api-deploy | |
--ENV_NAME=${{ github.event.inputs.target }} | |
--KOYEB_API_KEY=${{ secrets.KOYEB_API_KEY }} |