Skip to content

Commit

Permalink
fix: optimizations in the yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
brmassa committed Jun 22, 2024
1 parent 2de868a commit 346ab0c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 25 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,21 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# - name: Extract metadata (tags, labels) for Docker
# id: meta
# uses: docker/metadata-action@v4
# with:
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# tags: |
# type=raw,value=${{ matrix.OS_PLATFORM }}-${{ env.FLAX_VERSION_FULL }}
# type=raw,value=${{ matrix.OS_PLATFORM }}-${{ vars.FLAX_VERSION }}
# type=raw,value=${{ matrix.OS_PLATFORM }}-latest
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ matrix.OS_PLATFORM }}-${{ env.FLAX_VERSION_FULL }}
type=raw,value=${{ matrix.OS_PLATFORM }}-${{ vars.FLAX_VERSION }}
type=raw,value=${{ matrix.OS_PLATFORM }}-latest
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
${{ matrix.OS_PLATFORM }}-${{ env.FLAX_VERSION_FULL }}
${{ matrix.OS_PLATFORM }}-${{ vars.FLAX_VERSION }}
${{ matrix.OS_PLATFORM }}-latest
# tags: ${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push-by-digest: true
16 changes: 5 additions & 11 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,22 @@ build:
exit_codes: 2
script:
- python3 download.py
- source _env
- |
if [[ ! -d "app" ]]; then
echo "app folder does not exist. Job failed."
exit 2 # Exit with success code 2 to indicate non-failure
fi
- source _env
- export IMAGE_TAG_VERSION_FULL=${OS_PLATFORM}-$FLAX_VERSION_FULL
- export IMAGE_TAG_VERSION=${OS_PLATFORM}-$(eval echo ${FLAX_VERSION//_/.})
- export IMAGE_TAG_LATEST=${OS_PLATFORM}-latest
- |
docker build \
-t $CI_REGISTRY_IMAGE:$IMAGE_TAG_VERSION_FULL \
-t $CI_REGISTRY_IMAGE:$IMAGE_TAG_VERSION \
-t $CI_REGISTRY_IMAGE:$IMAGE_TAG_LATEST \
-t $CI_REGISTRY_IMAGE:${OS_PLATFORM}-$FLAX_VERSION_FULL \
-t $CI_REGISTRY_IMAGE:${OS_PLATFORM}-$(eval echo ${FLAX_VERSION//_/.}) \
-t $CI_REGISTRY_IMAGE:${OS_PLATFORM}-latest \
--build-arg OS=$OS \
--build-arg ENGINE_URL=$ENGINE_URL \
--build-arg OS_PLATFORM_URL=$OS_PLATFORM_URL .
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- |
docker push $CI_REGISTRY_IMAGE:$IMAGE_TAG_VERSION_FULL \
$CI_REGISTRY_IMAGE:$IMAGE_TAG_VERSION \
$CI_REGISTRY_IMAGE:$IMAGE_TAG_LATEST
- docker push $CI_REGISTRY_IMAGE --all-tags
parallel:
matrix:
- OS_PLATFORM: [
Expand Down

0 comments on commit 346ab0c

Please sign in to comment.