uopdate build #8
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 api service | |
"on": | |
push: | |
branches: [dev] | |
env: | |
WORKING_DIR: . | |
IMAGE_NAME: ochom/quickmq | |
jobs: | |
lint-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22" | |
cache-dependency-path: | | |
api/go.mod | |
api/go.sum | |
- name: Install dependencies | |
run: go mod tidy | |
working-directory: ${{ env.WORKING_DIR }} | |
- name: Run golangci-lint | |
uses: golangci/golangci-lint-action@v5 | |
with: | |
working-directory: ${{ env.WORKING_DIR }} | |
version: latest | |
args: --timeout 5m | |
- name: Run tests | |
run: go test ./... | |
working-directory: ${{ env.WORKING_DIR }} | |
build: | |
needs: lint-test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: ${{ env.IMAGE_NAME }}:latest | |
context: ${{ env.WORKING_DIR }} |