accounts-profiles-endpoint/.github/workflows/build.yml

42 lines
831 B
YAML
Raw Normal View History

2023-11-17 09:24:54 +05:30
name: Build
2023-11-17 10:09:45 +05:30
on:
push:
branches:
- master
env:
go_version: 1.21
2023-11-17 09:24:54 +05:30
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
2023-11-17 10:09:45 +05:30
- name: Setup Go ${{ env.go_version }}
2023-11-17 09:24:54 +05:30
uses: actions/setup-go@v4
with:
2023-11-17 10:09:45 +05:30
go-version: ${{ env.go_version }}
2023-11-17 09:24:54 +05:30
cache-dependency-path: go.sum
- name: Install dependencies
run: go get .
- name: Build
run: go build ./...
2023-11-17 10:09:45 +05:30
- 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