Skip to content

Commit

Permalink
ci: Generate blueos extension on pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl committed Dec 9, 2023
1 parent 40a203c commit fe5dee6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ jobs:

steps:
- name: Login to Docker Hub
if: success() && github.event_name != 'pull_request'
if: success()
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
Expand All @@ -182,9 +182,12 @@ jobs:
VERSION=${GITHUB_REF#refs/tags/}
fi
TAGS="--tag ${DOCKER_IMAGE}:${VERSION}"
echo $TAGS
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="$TAGS --tag ${DOCKER_IMAGE}:latest"
echo $TAGS
fi
echo $TAGS
echo "docker_image=${DOCKER_IMAGE}" >> $GITHUB_OUTPUT
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "buildx_args=${TAGS} --file Dockerfile ." >> $GITHUB_OUTPUT
Expand All @@ -207,15 +210,15 @@ jobs:
${{ steps.prepare.outputs.buildx_args }}
- name: Docker Buildx (push)
if: success() && github.event_name != 'pull_request'
if: success()
run: |
docker buildx build \
--output "type=image,push=true" \
--platform $PLATFORMS \
${{ steps.prepare.outputs.buildx_args }}
- name: Inspect image
if: always() && github.event_name != 'pull_request'
if: always()
run: |
docker buildx imagetools \
inspect ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}

0 comments on commit fe5dee6

Please sign in to comment.