Skip to content

Commit 2ec9209

Browse files
author
Malmahrouqi3
committed
trying to fix the issue with TAG
1 parent 0aca803 commit 2ec9209

File tree

1 file changed

+20
-27
lines changed

1 file changed

+20
-27
lines changed

.github/workflows/docker.yml

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
- { name: 'gpu', runner: 'ubuntu-22.04', base_image: 'nvcr.io/nvidia/nvhpc:23.11-devel-cuda12.3-ubuntu22.04' }
2424
- { name: 'gpu', runner: 'ubuntu-22.04-arm', base_image: 'nvcr.io/nvidia/nvhpc:23.11-devel-cuda12.3-ubuntu22.04' }
2525
runs-on: ${{ matrix.config.runner }}
26+
outputs:
27+
tag: ${{ steps.clone.outputs.tag }}
2628
steps:
2729
- name: Login
2830
uses: docker/login-action@v3
@@ -37,14 +39,12 @@ jobs:
3739
uses: docker/setup-qemu-action@v3
3840

3941
- name: Clone
42+
id: clone
4043
run: |
41-
if [ -n "${{ github.event.inputs.tag }}" ]; then
42-
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
43-
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
44-
echo "TAG=${{ github.ref_name }}" >> $GITHUB_ENV
45-
fi
46-
47-
git clone --branch ${{ env.TAG }} --depth 1 https://github.com/MFlowCode/MFC.git mfc
44+
TAG="${{ github.event.inputs.tag || github.ref_name }}"
45+
echo "tag=$TAG" >> $GITHUB_OUTPUT
46+
echo "TAG=$TAG" >> $GITHUB_ENV
47+
git clone --branch "$TAG" --depth 1 https://github.com/MFlowCode/MFC.git mfc
4848
4949
- name: Stage
5050
run: |
@@ -56,7 +56,7 @@ jobs:
5656
cp mfc/.github/.dockerignore /mnt/share/
5757
5858
- name: Build and Deploy
59-
uses: docker/build-push-action@v5
59+
uses: docker/build-push-action@v6
6060
with:
6161
builder: default
6262
context: /mnt/share
@@ -83,23 +83,16 @@ jobs:
8383
password: ${{ secrets.DOCKERHUB_PASSWORD }}
8484

8585
- name: Create and Push Manifest Lists
86+
env:
87+
TAG: ${{ needs.Container.outputs.tag }}
88+
REGISTRY: ${{ secrets.DOCKERHUB_USERNAME }}/mfc
8689
run: |
87-
docker manifest create ${{ secrets.DOCKERHUB_USERNAME }}/mfc:${{ env.TAG }}-cpu \
88-
${{ secrets.DOCKERHUB_USERNAME }}/mfc:${{ env.TAG }}-cpu-ubuntu-22.04 \
89-
${{ secrets.DOCKERHUB_USERNAME }}/mfc:${{ env.TAG }}-cpu-ubuntu-22.04-arm
90-
docker manifest push ${{ secrets.DOCKERHUB_USERNAME }}/mfc:${{ env.TAG }}-cpu
91-
92-
docker manifest create ${{ secrets.DOCKERHUB_USERNAME }}/mfc:latest-cpu \
93-
${{ secrets.DOCKERHUB_USERNAME }}/mfc:${{ env.TAG }}-cpu-ubuntu-22.04 \
94-
${{ secrets.DOCKERHUB_USERNAME }}/mfc:${{ env.TAG }}-cpu-ubuntu-22.04-arm
95-
docker manifest push ${{ secrets.DOCKERHUB_USERNAME }}/mfc:latest-cpu
96-
97-
docker manifest create ${{ secrets.DOCKERHUB_USERNAME }}/mfc:${{ env.TAG }}-gpu \
98-
${{ secrets.DOCKERHUB_USERNAME }}/mfc:${{ env.TAG }}-gpu-ubuntu-22.04 \
99-
${{ secrets.DOCKERHUB_USERNAME }}/mfc:${{ env.TAG }}-gpu-ubuntu-22.04-arm
100-
docker manifest push ${{ secrets.DOCKERHUB_USERNAME }}/mfc:${{ env.TAG }}-gpu
101-
102-
docker manifest create ${{ secrets.DOCKERHUB_USERNAME }}/mfc:latest-gpu \
103-
${{ secrets.DOCKERHUB_USERNAME }}/mfc:${{ env.TAG }}-gpu-ubuntu-22.04 \
104-
${{ secrets.DOCKERHUB_USERNAME }}/mfc:${{ env.TAG }}-gpu-ubuntu-22.04-arm
105-
docker manifest push ${{ secrets.DOCKERHUB_USERNAME }}/mfc:latest-gpu
90+
docker manifest create $REGISTRY:$TAG-cpu $REGISTRY:$TAG-cpu-ubuntu-22.04 $REGISTRY:$TAG-cpu-ubuntu-22.04-arm
91+
docker manifest create $REGISTRY:$TAG-gpu $REGISTRY:$TAG-gpu-ubuntu-22.04 $REGISTRY:$TAG-gpu-ubuntu-22.04-arm
92+
docker manifest create $REGISTRY:latest-cpu $REGISTRY:$TAG-cpu-ubuntu-22.04 $REGISTRY:$TAG-cpu-ubuntu-22.04-arm
93+
docker manifest create $REGISTRY:latest-gpu $REGISTRY:$TAG-gpu-ubuntu-22.04 $REGISTRY:$TAG-gpu-ubuntu-22.04-arm
94+
95+
docker manifest push $REGISTRY:$TAG-cpu
96+
docker manifest push $REGISTRY:$TAG-gpu
97+
docker manifest push $REGISTRY:latest-cpu
98+
docker manifest push $REGISTRY:latest-gpu

0 commit comments

Comments
 (0)