fix: If put transaction returns context deadline exceeded, check for … #67
Workflow file for this run
This file contains 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: Build and push OCI image to Docker Hub | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
check-current-branch: | |
runs-on: ubuntu-latest | |
outputs: | |
branch: ${{ steps.check_step.outputs.branch }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get current branch | |
id: check_step | |
# 1. Get the list of branches ref where this tag exists | |
# 2. Remove 'origin/' from that result | |
# 3. Put that string in output | |
run: | | |
raw=$(git branch -r --contains ${{ github.ref }}) | |
branch="$(echo ${raw//origin\//} | tr -d '\n')" | |
echo "{name}=branch" >> $GITHUB_OUTPUT | |
echo "Branches where this tag exists : $branch." | |
image: | |
runs-on: ubuntu-latest | |
needs: check-current-branch | |
if: contains(${{ needs.check.outputs.branch }}, 'main')` | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Get build args | |
id: build_args | |
run: | | |
echo "APP_COMMIT=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" | |
echo "APP_VERSION=$(git describe --tags --always --abbrev=0 --match='v[0-9]*.[0-9]*.[0-9]*' 2> /dev/null | sed 's/^.//')" >> "$GITHUB_OUTPUT" | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "./go.mod" | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: bsvb/arc | |
- name: Build and push image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
APP_COMMIT=${{ steps.build_args.outputs.APP_COMMIT }} | |
APP_VERSION=${{ steps.build_args.outputs.APP_VERSION }} |