Skip to content

Bump golang from 1.23.2-alpine to 1.23.3-alpine #541

Bump golang from 1.23.2-alpine to 1.23.3-alpine

Bump golang from 1.23.2-alpine to 1.23.3-alpine #541

Workflow file for this run

name: Go
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
go: ["1.20", "1.21", "1.22"]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Check format
run: gofmt -l
- name: Setup dependencies
run: go get
- name: Build
run: go build
- name: Test
run: go test ./... -coverpkg=./... -race -coverprofile=coverage.out -covermode=atomic
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
docker-build:
needs: build
runs-on: ubuntu-22.04
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
berviantoleo/${{ env.IMAGE_NAME }}
ghcr.io/${{ github.repository }}
env:
IMAGE_NAME: go-microservices
- name: Build and push Docker images
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}