build image and test in github #84
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: Build | |
on: | |
workflow_dispatch: | |
inputs: | |
do_release: | |
type: boolean | |
description: do release | |
required: true | |
pull_request: | |
branches: | |
- master | |
- release-* | |
paths-ignore: | |
- 'docs/**' | |
- '**.md' | |
- '.github/VERSION' | |
push: | |
branches: | |
- master | |
- release-* | |
paths-ignore: | |
- 'docs/**' | |
- '**.md' | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
cancel-in-progress: true | |
env: | |
GO_VERSION: '' | |
GOSEC_VERSION: '2.18.2' | |
HELM_VERSION: v3.13.3 | |
SUBMARINER_VERSION: '0.16.2' | |
jobs: | |
build-alb: | |
name: Build alb | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
- name: version # it will set the CURRENT_VERSION env | |
uses: HardNorth/[email protected] | |
with: | |
version-source: file | |
version-file: ./deploy/chart/alb/Chart.yaml | |
version-file-extraction-pattern: 'version: v([0-9]*\.[0-9]*\.[0-9]*)' | |
- uses: docker/setup-buildx-action@v3 | |
- uses: azure/setup-helm@v3 | |
with: | |
version: '${{ env.HELM_VERSION }}' | |
- name: build | |
env: | |
RELEASE_ME: "${{ github.event.inputs.do_release == 'true' }}" | |
run: | | |
set -x | |
./scripts/run-like-github-actions.sh build-alb | |
- name: Upload alb images to artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: alb | |
path: alb.tar | |
- name: Upload alb-nginx images to artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: alb-nginx | |
path: alb-nginx.tar | |
- name: Upload chart's to artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: alb-chart | |
path: alauda-alb2.tgz | |
- name: cr | |
uses: helm/[email protected] | |
with: | |
install_only: true | |
- name: release | |
if: ${{ inputs.do_release }} | |
env: | |
RELEASE_ME: "${{ github.event.inputs.do_release == 'true' }}" | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
DOCKER_CLI_EXPERIMENTAL: enabled | |
run: | | |
./scripts/run-like-github-actions.sh release-alb |