Redo builded action to use only shell
This commit is contained in:
parent
c8046eb98f
commit
43802259ed
@ -13,91 +13,64 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Log in to the Container registry
|
- name: Log in to the Container registry
|
||||||
uses: docker/login-action@v3
|
run: |
|
||||||
with:
|
docker login ${{ env.REGISTRY }} \
|
||||||
registry: registry.bouvais.lu
|
--username adrien \
|
||||||
username: adrien
|
--password "${{ secrets.DOCKER_PASSWORD }}"
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
# --- 1. BUILD & TEST BASE IMAGE ---
|
# --- 1. BUILD & TEST BASE IMAGE ---
|
||||||
- name: Extract metadata for Base
|
- name: Build Base image
|
||||||
id: meta-base
|
run: |
|
||||||
uses: docker/metadata-action@v5
|
docker build \
|
||||||
with:
|
-f ./images/base/dockerfile \
|
||||||
images: ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}
|
-t ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ github.ref_name }} \
|
||||||
tags: |
|
./images/base
|
||||||
type=raw,value=latest,enable={{is_default_branch}}
|
|
||||||
type=ref,event=branch
|
|
||||||
type=sha,format=short
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
|
|
||||||
- name: Build Base image (Local)
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: ./images/base
|
|
||||||
file: ./images/base/dockerfile
|
|
||||||
load: true
|
|
||||||
tags: ${{ steps.meta-base.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta-base.outputs.labels }}
|
|
||||||
|
|
||||||
- name: Test Base image
|
- name: Test Base image
|
||||||
run: |
|
run: |
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v ${{ github.workspace }}/tests:/tests \
|
-v ${{ github.workspace }}/tests:/tests \
|
||||||
${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ steps.meta-base.outputs.version }} \
|
${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ github.ref_name }} \
|
||||||
python3 /tests/base.py
|
python3 /tests/base.py
|
||||||
|
|
||||||
|
- name: Tag Base image as latest
|
||||||
|
run: |
|
||||||
|
docker tag ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ github.ref_name }} \
|
||||||
|
${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:latest
|
||||||
|
|
||||||
- name: Push Base image
|
- name: Push Base image
|
||||||
uses: docker/build-push-action@v5
|
run: |
|
||||||
with:
|
docker push ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ github.ref_name }}
|
||||||
context: ./images/base
|
docker push ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:latest
|
||||||
file: ./images/base/dockerfile
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta-base.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta-base.outputs.labels }}
|
|
||||||
|
|
||||||
# --- 2. BUILD & TEST JUPYTER IMAGE ---
|
# --- 2. BUILD & TEST JUPYTER IMAGE ---
|
||||||
- name: Extract metadata for Jupyter
|
- name: Build Jupyter image
|
||||||
id: meta-jupyter
|
run: |
|
||||||
uses: docker/metadata-action@v5
|
docker build \
|
||||||
with:
|
-f ./images/jupyter/dockerfile \
|
||||||
images: ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}
|
--build-arg BASE_IMAGE=${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ github.ref_name }} \
|
||||||
tags: |
|
-t ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:${{ github.ref_name }} \
|
||||||
type=raw,value=latest,enable={{is_default_branch}}
|
./images/jupyter
|
||||||
type=ref,event=branch
|
|
||||||
type=sha,format=short
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
|
|
||||||
- name: Build Jupyter image (Local)
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: ./images/jupyter
|
|
||||||
file: ./images/jupyter/dockerfile
|
|
||||||
load: true
|
|
||||||
build-args: |
|
|
||||||
BASE_IMAGE=${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ steps.meta-base.outputs.version }}
|
|
||||||
tags: ${{ steps.meta-jupyter.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta-jupyter.outputs.labels }}
|
|
||||||
|
|
||||||
- name: Test Jupyter dependencies
|
- name: Test Jupyter dependencies
|
||||||
run: |
|
run: |
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v ${{ github.workspace }}/tests:/tests \
|
-v ${{ github.workspace }}/tests:/tests \
|
||||||
${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:${{ steps.meta-base.outputs.version }} \
|
${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:${{ github.ref_name }} \
|
||||||
python3 /tests/dependencies.py
|
python3 /tests/dependencies.py
|
||||||
|
|
||||||
|
- name: Tag Jupyter image as latest
|
||||||
|
run: |
|
||||||
|
docker tag ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:${{ github.ref_name }} \
|
||||||
|
${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:latest
|
||||||
|
|
||||||
- name: Push Jupyter image
|
- name: Push Jupyter image
|
||||||
uses: docker/build-push-action@v5
|
run: |
|
||||||
with:
|
docker push ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:${{ github.ref_name }}
|
||||||
context: ./images/jupyter
|
docker push ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:latest
|
||||||
file: ./images/jupyter/dockerfile
|
|
||||||
push: true
|
|
||||||
build-args: |
|
|
||||||
BASE_IMAGE=${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ steps.meta-base.outputs.version }}
|
|
||||||
tags: ${{ steps.meta-jupyter.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta-jupyter.outputs.labels }}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user