Skip to content

docker(deps): bump golang from 1.20.4 to 1.21.0 #246

docker(deps): bump golang from 1.20.4 to 1.21.0

docker(deps): bump golang from 1.20.4 to 1.21.0 #246

Workflow file for this run

name: ci
on:
push:
branches:
- main
paths-ignore:
- "README.md"
- "LICENSE"
tags:
- "v*.*.*"
pull_request:
branches:
- main
paths-ignore:
- "README.md"
- "LICENSE"
env:
IMAGE_NAME: lobsterbandit/dev-golang
DEFAULT_VERSION: edge
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=${IMAGE_NAME}
VERSION=${DEFAULT_VERSION}
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
fi
TAGS="${DOCKER_IMAGE}:${VERSION}"
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
fi
echo ::set-output name=tags::${TAGS}
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: linux/amd64
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4.0.0
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.prep.outputs.tags }}