volcano.sh/volcano@v1.9.0/.github/workflows/release.yaml (about) 1 name: daily release 2 on: 3 schedule: 4 # Runs at 0:00 and 12:00 UTC every day 5 - cron: '0 */12 * * *' 6 # Automatically push the image when releasing the version 7 push: 8 tags: 9 - "v*.*.*" 10 11 12 jobs: 13 docker: 14 runs-on: ubuntu-latest 15 env: 16 GOPATH: /home/runner/work/${{ github.repository }} 17 steps: 18 - name: Install Go 19 uses: actions/setup-go@v4 20 with: 21 go-version: 1.21.x 22 23 - name: Install musl 24 run: | 25 wget http://musl.libc.org/releases/musl-1.2.1.tar.gz 26 tar -xf musl-1.2.1.tar.gz && cd musl-1.2.1 27 ./configure 28 make && sudo make install 29 30 - name: Checkout code 31 uses: actions/checkout@v3 32 with: 33 fetch-depth: 0 34 path: ./src/github.com/${{ github.repository }} 35 36 - name: Get tag or branch name 37 run: | 38 echo "TAG=${{ github.ref_name }}" >> $GITHUB_ENV 39 echo "RELEASE_VER=${{ github.ref_name }}" >> $GITHUB_ENV 40 41 - name: Update tag and release_ver 42 if: ${{ github.ref_name == 'master' }} 43 run: | 44 echo "TAG=latest" >> $GITHUB_ENV 45 echo "RELEASE_VER=latest" >> $GITHUB_ENV 46 47 - uses: actions/cache@v2 48 with: 49 path: ~/go/pkg/mod 50 key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} 51 52 - name: Run verify test 53 run: | 54 make verify 55 make TAG=${{ env.TAG }} generate-yaml 56 make verify-generated-yaml 57 make unit-test 58 working-directory: ./src/github.com/${{ github.repository }} 59 60 - name: Login to DockerHub 61 uses: docker/login-action@v1 62 with: 63 username: ${{ secrets.DOCKERHUB_USERNAME }} 64 password: ${{ secrets.DOCKERHUB_TOKEN }} 65 66 - name: Daily Release 67 run: docker buildx create --use && make TAG=${{ env.TAG }} RELEASE_VER=${{ env.RELEASE_VER }} DOCKER_USERNAME=${{ secrets.DOCKERHUB_USERNAME }} DOCKER_PASSWORD=${{ secrets.DOCKERHUB_TOKEN }} CC=/usr/local/musl/bin/musl-gcc DOCKER_PLATFORMS="linux/amd64,linux/arm64" BUILDX_OUTPUT_TYPE=registry release 68 working-directory: ./src/github.com/${{ github.repository }} 69 70 - name: Loginout DockerHub 71 run: docker logout