Skip to content

Commit

Permalink
[LT] Add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
rouja committed Aug 6, 2024
1 parent af97838 commit 47853f7
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/lt-tag-and-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build and push LanguageTool image
run-name: Build and push LanguageTool image

on:
workflow_dispatch:
inputs:
dinumTag:
description: 'DINUM docker image tag'
required: true
commitSha:
description: 'Git commit sha to build the image'
required: true

env:
DOCKER_USER: 1001:127

jobs:
build-and-push-backend:
runs-on: ubuntu-latest
steps:
-
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: "dockerfiles,secrets"
-
name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
token: ${{ steps.app-token.outputs.token }}
ref: ${{ github.event.inputs.commitSha }}
-
name: Load sops secrets
uses: rouja/actions-sops@main
with:
secret-file: secrets/numerique-gouv/dockerfiles/secrets.enc.env
age-key: ${{ secrets.SOPS_PRIVATE }}
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
run: echo "$DOCKER_HUB_PASSWORD" | docker login -u "$DOCKER_HUB_USER" --password-stdin
-
name: Build and push
run: |
cd dockerfiles/lt;
docker build \
--annotation "commitSha=${{ github.event.inputs.commitSha }}" \
--push . -t lasuite/lt:${{ github.event.inputs.dinumTag }};

0 comments on commit 47853f7

Please sign in to comment.