Update .github/workflows/build.yml
This commit is contained in:
27
.github/workflows/build.yml
vendored
27
.github/workflows/build.yml
vendored
@ -22,12 +22,23 @@ on:
|
||||
|
||||
|
||||
jobs:
|
||||
testing:
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.24.x]
|
||||
os: [ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- uses: actions/checkout@v4
|
||||
- run: |
|
||||
go get -u .
|
||||
go test ./.
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
# if: startsWith(github.ref, 'refs/tags')
|
||||
steps:
|
||||
|
||||
- name: Extract Version
|
||||
id: version_step
|
||||
run: |
|
||||
@ -38,34 +49,28 @@ jobs:
|
||||
# echo "##[set-output name=version;]VERSION=${GITHUB_REF#$"refs/tags/v"}"
|
||||
# echo "##[set-output name=version_tag;]$GITHUB_REPOSITORY:${GITHUB_REF#$"refs/tags/v"}"
|
||||
# echo "##[set-output name=latest_tag;]$GITHUB_REPOSITORY:latest"
|
||||
|
||||
# - name: Print Version
|
||||
# run: |
|
||||
# echo ${{steps.version_step.outputs.version_tag}}
|
||||
# echo ${{steps.version_step.outputs.latest_tag}}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
platforms: |
|
||||
linux/amd64
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: docker.savin.nyc
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
# - name: PrepareReg Names
|
||||
# id: read-docker-image-identifiers
|
||||
# run: |
|
||||
# echo VERSION_TAG=$(echo ${{ steps.version_step.outputs.version_tag }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
|
||||
# echo LASTEST_TAG=$(echo ${{ steps.version_step.outputs.latest_tag }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v6
|
||||
@ -78,8 +83,6 @@ jobs:
|
||||
tags: |
|
||||
docker.savin.nyc/${{ github.event.repository.name }}:latest
|
||||
# ${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }}
|
||||
|
||||
|
||||
# latest
|
||||
# build-args: |
|
||||
# docker.savin.nyc/${{ github.event.repository.name }}:latest
|
||||
@ -95,7 +98,7 @@ jobs:
|
||||
id: auto-deploy-dev
|
||||
uses: https://git.savin.nyc/gh-actions/auto-exec-workflow@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GUTHUB_TOKEN }}
|
||||
GITEA_TOKEN: ${{ secrets.CI_CD_GITEA_TOKEN }}
|
||||
Version: ${{ steps.version.output.updated-version }}
|
||||
|
||||
- name: Output Summary
|
||||
|
Reference in New Issue
Block a user