diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 969d076..8b29454 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,14 +77,39 @@ jobs: result = [] tags.split("\n").forEach(function (item) { short_tag = item.trim().split(":")[1]; - if (short_tag != "latest") { + if (short_tag == "master" || short_tag == "main") { + result.push("latest"); + } else if (short_tag != "latest") { result.push(short_tag); } }) return result.join(","); result-encoding: string - - name: Get result - run: echo "${{ steps.tags.outputs.result }}" + + - name: Get Tags + run: | + echo "${{ steps.tags.outputs.result }}" + + - uses: actions/github-script@v6 + id: normalized + with: + script: | + tags = `${{ join(steps.meta.outputs.tags, ',') }}` + result = [] + tags.split("\n").forEach(function (item) { + short_tag = item.trim().split(":")[1]; + if (short_tag == "master" || short_tag == "main") { + result.push("${{ env.IMAGE_NAME }}:latest"); + } else if (short_tag != "latest") { + result.push("${{ env.IMAGE_NAME }}:" + short_tag); + } + }) + return result.join(","); + result-encoding: string + + - name: Get Normalized Docker Image + run: | + echo "${{ steps.normalized.outputs.result }}" # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action @@ -97,7 +122,7 @@ jobs: RELEASE_VERSION_ARG="${{ steps.tags.outputs.result }}" platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' || github.event.inputs.push == 'true' }} - tags: ${{ steps.meta.outputs.tags }} + tags: ${{ steps.normalized.outputs.result }} labels: ${{ steps.meta.outputs.labels }} outputs: @@ -136,7 +161,9 @@ jobs: CURRENT_VERSION=$(grep "appVersion: " helm/easyhaproxy/Chart.yaml | sed 's#appVersion: "\(.*\)"#\1#g') if [ "$TAG" = "$CURRENT_VERSION" ]; then - echo "Skipping update version..." + echo "Skipping version $CURRENT_VERSION..." + elif [ "$TAG" = "latest" ]; then + echo "Skipping latest version..." else sed -i "s#easy-haproxy:[a-zA-Z0-9\.-]*#easy-haproxy:$TAG#g" deploy/docker/docker-compose.yml sed -i "s#version: \"[a-zA-Z0-9\.-]*\"#version: \"$TAG\"#g" deploy/kubernetes/easyhaproxy-*.yml diff --git a/.run/pytest in tests.run.xml b/.run/pytest in tests.run.xml new file mode 100644 index 0000000..9b5784c --- /dev/null +++ b/.run/pytest in tests.run.xml @@ -0,0 +1,21 @@ + + + + + \ No newline at end of file