Skip to content

Merge pull request #272 from sipcapture/go-builder-upgrade #99

Merge pull request #272 from sipcapture/go-builder-upgrade

Merge pull request #272 from sipcapture/go-builder-upgrade #99

Workflow file for this run

name: Go CI/CD
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
env:
REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21
- name: Libraries
run: sudo apt-get install -y libpcap-dev
- name: Build
run: go build -ldflags "-s -w" -o heplify *.go
docker-push:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
needs: build
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
- id: tag_bump
name: Bump version and push tag
uses: anothrNick/github-tag-action@1.53.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: none
BRANCH: master
- name: Log in to the Container registry
uses: docker/login-action@v2.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4.1.1
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
latest
${{ steps.tag_bump.outputs.tag }}
- name: Build and push
uses: docker/build-push-action@v3.2.0
with:
context: .
file: ./docker/heplify/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}