diff --git a/.github/workflows/test-docker-retag.yaml b/.github/workflows/test-docker-retag.yaml new file mode 100644 index 000000000..9e1b11a67 --- /dev/null +++ b/.github/workflows/test-docker-retag.yaml @@ -0,0 +1,41 @@ +on: + pull_request: + paths-ignore: + - "docs/**" + - "helm/**" + - "assets/**" + - "**.md" +name: Docker Retag from Edge +jobs: + docker-retag: + runs-on: ubuntu-latest + + steps: + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Extract Tag or SHA + id: meta + run: | + if [[ "${{ github.event_name }}" == "push" ]]; then + TAG_NAME="${GITHUB_REF#refs/tags/}" + else + TAG_NAME="test-pr-${GITHUB_SHA::7}" + fi + echo "tag=$TAG_NAME" >> "$GITHUB_OUTPUT" + + - name: Retag from edge and push + run: | + docker buildx imagetools create \ + --tag parseable/parseable:${{ steps.meta.outputs.tag }} \ + parseable/parseable:edge + + - name: Inspect new tag (optional) + run: | + docker buildx imagetools inspect parseable/parseable:${{ steps.meta.outputs.tag }}