feat: update device-plugin yaml #5
Workflow file for this run
This file contains hidden or 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: | |
| push: | |
| branches: [ "main" ] | |
| tags: | |
| - v[0-9]+.[0-9]+.[0-9]+.[0-9]+ | |
| - v[0-9]+.[0-9]+.[0-9]+ | |
| - v[0-9]+.[0-9]+ | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.19' | |
| - name: Build | |
| run: go build -ldflags="-X 'main.Version=v0.7.4' -X 'main.Time=$(LC_TIME=en_US.UTF-8 date)' -X 'main.Commit=$(git rev-parse --short HEAD)'" -o k8s-device-plugin cmd/manager.go | |
| #- name: Run tests | |
| # run: | | |
| # go test ./pkg/va-vg/... -v | |
| build: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Docker Login | |
| if: ${{ github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main') }} | |
| uses: docker/login-action@v3.6.0 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_TOKEN }} | |
| password: ${{ secrets.DOCKERHUB_PASSWD }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| driver-opts: image=moby/buildkit:master | |
| - name: Extract tag name | |
| id: tag | |
| run: | | |
| if [[ "${{ github.ref }}" == refs/tags/* ]]; then | |
| TAG_NAME="${GITHUB_REF#refs/tags/}" | |
| echo "VERSION=${TAG_NAME#v}" >> $GITHUB_OUTPUT | |
| echo "Extracted version: ${VERSION}" | |
| else | |
| echo "VERSION=latest" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Build and optionally push | |
| uses: docker/build-push-action@v6.18.0 | |
| with: | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main') }} | |
| tags: projecthami/biren-device-plugin:${{ steps.tag.outputs.VERSION }} |