-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (51 loc) · 1.56 KB
/
grist-tag-and-push.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Build and push grist image
on:
workflow_dispatch:
inputs:
gristVersion:
description: 'Grist base image'
required: true
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/grist;
docker build . -t lasuite/grist:${{ github.event.inputs.dinumTag }} \
--build-args GRIST_VERSION=${{ github.event.inputs.gristVersion }} \
--push