diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index aa4783b..681c8ef 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -20,9 +20,18 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@main + + - name: Set short SHA + id: vars + run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_OUTPUT + shell: bash + + - name: Build image shell: bash - run: docker build -t ${{env.imageRepository}}:${{env.version}} -f ./src/Kibana.Alerts/Dockerfile ./src/Kibana.Alerts/ + run: docker build -t ${{env.imageRepository}}:${{ github.sha }} -f ./src/Kibana.Alerts/Dockerfile ./src/Kibana.Alerts/ - name: Login to Docker Hub uses: docker/login-action@v1 with: @@ -36,5 +45,6 @@ jobs: # docker manifest create ${{env.imageRepository}}:latest ${{env.imageRepository}}:build-${{env.version}}-amd64 # docker manifest push ${{env.imageRepository}}:${{env.version}} # docker manifest push ${{env.imageRepository}}:latest - docker tag ${{env.imageRepository}}:${{env.version}} ${{env.imageRepository}}:latest - docker push --all-tags ${{env.imageRepository}}:${{env.version}} + docker tag ${{env.imageRepository}}:${{ github.sha }} ${{env.imageRepository}}:latest + docker tag ${{env.imageRepository}}:${{ github.sha }} ${{env.imageRepository}}:{{env.version}} + docker push --all-tags ${{env.imageRepository}}:${{ github.sha }}