forked from Project-HAMi/ascend-device-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (35 loc) · 1.15 KB
/
dev.yml
File metadata and controls
43 lines (35 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: CI
on:
pull_request:
branches: [ "main" ]
env:
GO_VERSION: "1.22.5"
jobs:
build:
env:
IMAGE_NAME: ${{ secrets.IMAGE_NAME || 'projecthami/ascend-device-plugin' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: true
- name: Get branch names.
id: branch-names
uses: tj-actions/branch-names@v8
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
push: false
build-args: |
BASE_IMAGE=ubuntu:20.04
GO_VERSION=${{ env.GO_VERSION }}
VERSION=${{ steps.branch-names.outputs.current_branch || steps.branch-names.outputs.tag }}-${{ github.sha }}
tags: ${{ env.IMAGE_NAME }}:dev