Skip to content

Meshery Adapter for Nighthawk v0.7.1 #49

Meshery Adapter for Nighthawk v0.7.1

Meshery Adapter for Nighthawk v0.7.1 #49

name: Meshery Nighthawk Build and Release
on:
release:
types: [published]
push:
branches:
- "master"
paths-ignore:
- ".github/**"
jobs:
build:
name: Build check
runs-on: ubuntu-22.04
# needs: [lint, error_check, static_check, vet, sec_check, tests]
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.22
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go build .
docker:
name: Docker build and push
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Docker login
uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker edge build & tag
if: startsWith(github.ref, 'refs/tags/') != true && success()
run: |
DOCKER_BUILDKIT=1 docker build --no-cache -t ${{ secrets.IMAGE_NAME }}:edge-latest --build-arg TOKEN=${{ secrets.GLOBAL_TOKEN }} --build-arg GIT_COMMITSHA=${GITHUB_SHA::7} --build-arg VERSION="edge-latest" .
docker tag ${{ secrets.IMAGE_NAME }}:edge-latest ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_SHA::7}
- name: Docker edge push
if: startsWith(github.ref, 'refs/tags/') != true && success()
run: |
docker push ${{ secrets.IMAGE_NAME }}:edge-latest
docker push ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_SHA::7}
- name: Docker stable build & tag
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
run: |
DOCKER_BUILDKIT=1 docker build --no-cache -t ${{ secrets.IMAGE_NAME }}:stable-latest --build-arg GIT_COMMITSHA=${GITHUB_SHA::7} --build-arg VERSION=${GITHUB_REF/refs\/tags\//} .
docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_REF/refs\/tags\//}
docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_SHA::7}
- name: Docker stable push
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
run: |
docker push ${{ secrets.IMAGE_NAME }}:stable-latest
docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_REF/refs\/tags\//}
docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_SHA::7}
- name: Docker Hub Description
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ${{ secrets.IMAGE_NAME }}