-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from numerique-gouv/build-planka
Add job to build planka image
- Loading branch information
Showing
1 changed file
with
66 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,66 @@ | ||
run-name: Build and push planka image | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dinumTag: | ||
description: 'DINUM docker image tag' | ||
required: true | ||
default: "0.0" | ||
commitSha: | ||
description: 'Git commit sha to build the image' | ||
required: true | ||
default: "6b3f8876840988595807191a058ac7b0c431d066" | ||
repository: | ||
description: "Git repository to clone" | ||
required: true | ||
default: "numerique-gouv/planka" | ||
|
||
|
||
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,planka" | ||
- | ||
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: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
token: ${{ steps.app-token.outputs.token }} | ||
ref: ${{ github.event.inputs.commitSha }} | ||
repository: ${{ github.event.inputs.repository }} | ||
path: planka | ||
- | ||
name: Build and push | ||
run: | | ||
cd planka; | ||
docker build --annotation "commitSha=${{ github.event.inputs.commitSha }}" \ | ||
--push . -t lasuite/planka:${{ github.event.inputs.dinumTag }}; |