Publish Production #796
Workflow file for this run
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: Publish Production | |
on: | |
repository_dispatch: | |
types: [new-snmp-profiles] | |
push: | |
branches: | |
- main | |
release: | |
types: [created] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
- uses: nowsprinting/check-version-format-action@v3 | |
id: version | |
with: | |
prefix: 'v' | |
- name: Set Release Version | |
run: | | |
echo "KENTIK_KTRANSLATE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV | |
if: steps.version.outputs.is_valid == 'true' | |
- name: Set NonRelease Version | |
run: | | |
echo KENTIK_KTRANSLATE_VERSION=`date +"kt-%Y-%m-%d-${GITHUB_RUN_ID}"` >> $GITHUB_ENV | |
if: steps.version.outputs.is_valid == 'false' | |
- name: Setup Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.20.4' | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to Quay.IO | |
uses: docker/login-action@v1 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_LOGIN_TOKEN }} | |
- name: Install dependencies | |
run: sudo apt-get install make libpcap-dev | |
- name: Run build | |
run: | | |
echo ${{ env.KENTIK_KTRANSLATE_VERSION }} | |
KENTIK_KTRANSLATE_VERSION=${{ env.KENTIK_KTRANSLATE_VERSION }} make | |
- name: Run vet | |
run: | | |
go vet . | |
- name: Run testing | |
run: make test | |
- name: Build and Publish Docker | |
uses: docker/build-push-action@v2 | |
with: | |
builder: ${{ steps.buildx.outputs.name }} | |
context: . | |
platforms: linux/amd64, linux/arm64 | |
push: true | |
tags: kentik/ktranslate:${{ env.KENTIK_KTRANSLATE_VERSION }}, kentik/ktranslate:latest, kentik/ktranslate:v2, quay.io/kentik/ktranslate:v2, quay.io/kentik/ktranslate:latest, quay.io/kentik/ktranslate:${{ env.KENTIK_KTRANSLATE_VERSION }} | |
build-args: | | |
MAXMIND_LICENSE_KEY=${{ secrets.MM_DOWNLOAD_KEY }} | |
KENTIK_KTRANSLATE_VERSION=${{ env.KENTIK_KTRANSLATE_VERSION }} | |
secrets: | | |
MAXMIND_LICENSE_KEY=${{ secrets.MM_DOWNLOAD_KEY }} | |
- name: Build and Publish Docker (AWS Lambda) | |
uses: docker/build-push-action@v2 | |
with: | |
builder: ${{ steps.buildx.outputs.name }} | |
context: . | |
platforms: linux/arm64 | |
push: true | |
tags: kentik/ktranslate:v2arm64 | |
build-args: | | |
MAXMIND_LICENSE_KEY=${{ secrets.MM_DOWNLOAD_KEY }} | |
KENTIK_KTRANSLATE_VERSION=${{ env.KENTIK_KTRANSLATE_VERSION }} | |
secrets: | | |
MAXMIND_LICENSE_KEY=${{ secrets.MM_DOWNLOAD_KEY }} | |
- name: Publish binary | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ktranslate | |
path: bin/ktranslate |