Skip to content

migrate avatar api #274

migrate avatar api

migrate avatar api #274

name: Publish api Docker image
on:
push:
branches:
- kafka
paths-ignore:
- '**/README.md'
pull_request:
branches:
- '**'
jobs:
push_to_registry:
name: Publish Docker image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
args: --timeout=10m
- name: Go Test
run: make test
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v3
with:
images: minghsu0107/random-chat-api
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
build-args: VERSION=${{ github.ref_name }}
file: ./build/Dockerfile.api
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}