Bump actions/checkout from 4.2.2 to 5.0.0 #330
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Protobuf Docker Image | |
on: | |
push: | |
tags: [ '**' ] | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
paths: | |
- .github/workflows/protobuf-dockerimage.yml | |
- protobuf/Dockerfile | |
- protobuf/protoc-wrapper | |
permissions: | |
contents: read | |
jobs: | |
build: | |
strategy: | |
matrix: | |
TARGETARCH: [amd64] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- name: Build the Docker image | |
run: docker build protobuf/. -t build-protobuf | |
env: | |
TARGETARCH: ${{ matrix.TARGETARCH }} | |
- name: Push the Docker image | |
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') | |
run: | | |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
function tag_and_push { | |
docker tag build-protobuf "otel/build-protobuf:${1}" && docker push "otel/build-protobuf:${1}" | |
} | |
if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then | |
tag_and_push "latest" | |
elif [[ "${GITHUB_REF}" =~ refs/tags/v[0-9]+\.[0-9]+\.[0-9]+ ]]; then | |
TAG="${GITHUB_REF#"refs/tags/v"}" | |
tag_and_push "${TAG}" | |
else | |
tag_and_push "${GITHUB_REF#"refs/tags/"}" | |
fi | |
env: | |
TARGETARCH: ${{ matrix.TARGETARCH }} |