Add build-push action

This commit is contained in:
Ayaz Salikhov
2022-05-12 15:17:49 +03:00
parent ba9095725b
commit f1169217dc
2 changed files with 27 additions and 12 deletions

View File

@@ -0,0 +1,23 @@
name: "Build, push image"
description: "Build and push image to GitHub artifacts"
inputs:
imageName:
description: "Image name to be built"
required: true
runs:
using: "composite"
steps:
- name: Build image 🛠
uses: docker/build-push-action@v3
with:
context: ${{ inputs.imageName }}/
file: ${{ inputs.imageName }}/Dockerfile
tags: jupyter/${{ inputs.imageName }}:latest
outputs: type=docker,dest=/tmp/${{ inputs.imageName }}.tar
- name: Upload artifact 💾
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.imageName }}
path: /tmp/${{ inputs.imageName }}.tar

View File

@@ -7,7 +7,7 @@ on:
pull_request:
paths:
- ".github/workflows/build-docker.yml"
- ".github/actions/create-dev-env/**"
- ".github/actions/**"
- "all-spark-notebook/**"
- "base-notebook/**"
@@ -27,7 +27,7 @@ on:
- master
paths:
- ".github/workflows/build-docker.yml"
- ".github/actions/create-dev-env/**"
- ".github/actions/**"
- "all-spark-notebook/**"
- "base-notebook/**"
@@ -61,17 +61,9 @@ jobs:
- name: Create dev environment 📦
uses: ./.github/actions/create-dev-env
- name: Build image 🛠
uses: docker/build-push-action@v3
uses: ./.github/actions/build-push-image
with:
context: base-notebook/
file: base-notebook/Dockerfile
tags: jupyter/base-notebook:latest
outputs: type=docker,dest=/tmp/base-notebook.tar
- name: Upload artifact 💾
uses: actions/upload-artifact@v3
with:
name: base-notebook
path: /tmp/base-notebook.tar
imageName: base-notebook
test-base-notebook:
name: Test base-notebook