accounts-profiles-endpoint/.github/workflows/build.yml
2023-11-17 05:39:45 +01:00

42 lines
831 B
YAML

name: Build
on:
push:
branches:
- master
env:
go_version: 1.21
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ env.go_version }}
uses: actions/setup-go@v4
with:
go-version: ${{ env.go_version }}
cache-dependency-path: go.sum
- name: Install dependencies
run: go get .
- name: Build
run: go build ./...
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: ghcr.io/${{ github.repository }}:latest