Skip to content

ci: use docker compose instead of docker-compose #6

ci: use docker compose instead of docker-compose

ci: use docker compose instead of docker-compose #6

Workflow file for this run

name: Binary
on:
workflow_dispatch: {}
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/bivac
DOCKER_CLI_EXPERIMENTAL: enabled
jobs:
linting:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Run Go Vet
run: make vet
- name: Lint code
run: make lint
tests:
name: Unit testing
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Run unit tests
run: make test
- name: Send coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage
build-binary:
name: Build Binary
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build binary
run: make bivac
build-docker-image:
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build docker image
run: docker build --build-arg GO_VERSION=1.14 --build-arg GOOS=linux --build-arg GOARCH=amd64 .
publish-docker-image-latest:
name: Publish docker image tagged latest
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
steps:
- name: Check out the repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Login to Github Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build and push docker images
run: |
IMAGE_NAME=${{ env.IMAGE_NAME }} IMAGE_VERSION=latest KEEP_IMAGES=yes make docker-images