From 00a82999b44ca1f3e55d896731d3d24906a9e7ce Mon Sep 17 00:00:00 2001 From: Michael Sauter Date: Fri, 29 Sep 2023 13:16:32 +0200 Subject: [PATCH] Fix release pipeline --- .github/workflows/test.yaml | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..61db351 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,46 @@ +name: Release images Alt +on: + pull_request: + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_BASE: ${{ github.repository }} + +jobs: + build: + name: Build and release images + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - id: createImageTag + name: Create image tag + run: | + IMAGE_TAG=$(echo ${{ github.event.release.tag_name }} | sed 's/v//') + echo "{imageTag}={$IMAGE_TAG}" >> $GITHUB_OUTPUT + + - id: createImageBase + run: | + echo "imageBase=${IMAGE_BASE,,}" >> $GITHUB_OUTPUT + + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v2 + + - name: Log into registry ${{ env.REGISTRY }} + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and release Docker image + id: build-and-push + uses: docker/build-push-action@v4 + with: + context: . + file: build/images/Dockerfile.go-toolset + push: true + tags: ${{ env.REGISTRY }}/${{steps.createImageBase.outputs.imageBase}}/go-toolset:test