2022-03-04 21:23:48 +03:00
|
|
|
name: Building and pushing mcr
|
2024-02-27 03:36:05 +03:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*"
|
2022-03-04 21:23:48 +03:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
id-token: write
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Lint
|
|
|
|
uses: golangci/golangci-lint-action@v2
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
args:
|
|
|
|
-v
|
|
|
|
--max-same-issues 10
|
|
|
|
--disable-all
|
|
|
|
--exclude-use-default=false
|
|
|
|
-E asciicheck
|
|
|
|
-E deadcode
|
|
|
|
-E errcheck
|
|
|
|
-E forcetypeassert
|
|
|
|
-E gocritic
|
|
|
|
-E gofmt
|
|
|
|
-E goimports
|
|
|
|
-E gosimple
|
|
|
|
-E govet
|
|
|
|
-E ineffassign
|
|
|
|
-E misspell
|
|
|
|
-E staticcheck
|
|
|
|
-E structcheck
|
|
|
|
-E typecheck
|
|
|
|
-E unused
|
|
|
|
-E varcheck
|
|
|
|
build:
|
2024-02-27 03:36:05 +03:00
|
|
|
runs-on:
|
|
|
|
labels: [self-hosted, "1ES.Pool=1es-aks-ip-masq-agent-pool-ubuntu"]
|
2022-03-04 21:23:48 +03:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
2024-02-27 03:36:05 +03:00
|
|
|
- name: Build
|
2022-03-04 21:23:48 +03:00
|
|
|
run: |
|
2024-02-27 03:36:05 +03:00
|
|
|
make build
|
|
|
|
- name: Publish
|
2022-03-04 21:23:48 +03:00
|
|
|
run: |
|
2024-02-27 03:36:05 +03:00
|
|
|
echo "Logging in with Azure CLI"
|
|
|
|
az login --identity
|
|
|
|
|
|
|
|
echo "Logging into ACR"
|
2022-03-04 21:23:48 +03:00
|
|
|
az acr login -n ${{ secrets.AZURE_REGISTRY_SERVER }}
|
|
|
|
|
2024-02-27 03:36:05 +03:00
|
|
|
echo "Pushing to ACR"
|
|
|
|
REGISTRY=${{ secrets.AZURE_REGISTRY_SERVER }}/public/aks VERSION="${{ github.ref_name }}" make all-manifest
|