Build/env dev docker 127 (#196)

build: add workflow to create HDK env Docker Image

- make bot username a secret
- update Makefile to pull the HDK image
- have a separate Makefile for the dev specific Docker Image needs
This commit is contained in:
Arthur Meyre
2021-08-25 14:09:54 +02:00
committed by GitHub
parent ff260b2cd2
commit 202dffb4a5
5 changed files with 76 additions and 17 deletions

View File

@@ -13,19 +13,15 @@ jobs:
runs-on: ubuntu-20.04
container:
image: ghcr.io/zama-ai/zamalang-compiler
image: ghcr.io/zama-ai/hdk-env
credentials:
username: zama-bot
username: ${{ secrets.BOT_USERNAME }}
password: ${{ secrets.BOT_TOKEN }}
strategy:
matrix:
python-version: [3.8]
steps:
- name: Install Git
run: apt-get install git -y
- name: Install Graphviz
run: apt-get install graphviz* -y
- name: Checkout Code
uses: actions/checkout@v2
with:
@@ -109,7 +105,7 @@ jobs:
SLACK_ICON: https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: 'Build finished with status ${{ job.status }}'
SLACK_USERNAME: zama-bot
SLACK_USERNAME: ${{ secrets.BOT_USERNAME }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
publish-docs:
@@ -156,5 +152,5 @@ jobs:
SLACK_ICON: https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: 'Publishing documentation finished with status ${{ job.status }}'
SLACK_USERNAME: zama-bot
SLACK_USERNAME: ${{ secrets.BOT_USERNAME }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

54
.github/workflows/docker-env.yaml vendored Normal file
View File

@@ -0,0 +1,54 @@
name: Docker image (HDK dev/CI)
on:
push:
branches:
- main
paths:
- docker/Dockerfile.hdk-env
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build_publish:
name: Build & Push the HDK env Docker Image
runs-on: ubuntu-20.04
env:
IMAGE_URL: ghcr.io/zama-ai/hdk-env
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.BOT_USERNAME }}
password: ${{ secrets.BOT_TOKEN }}
- name: Build hdk-env Image
if: ${{ success() && !cancelled() }}
uses: docker/build-push-action@v2
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
file: docker/Dockerfile.hdk-env
push: true
tags: "${{ env.IMAGE_URL }}:latest"
no-cache: true
- name: Slack Notification
if: ${{ always() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: hdk-updates
SLACK_ICON: https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Publishing Docker Image ${{ env.IMAGE_URL }} \
finished with status ${{ job.status }}"
SLACK_USERNAME: ${{ secrets.BOT_USERNAME }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}