ADD image build and push

This commit is contained in:
maximo tejeda 2024-11-15 09:49:34 -04:00
parent af7c252c4e
commit ba26e32d7a
2 changed files with 10 additions and 5 deletions

View File

@ -11,7 +11,8 @@ jobs:
USERNAME: ${{ vars.USERNAME }}
TAG_VERSION: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
@ -23,13 +24,14 @@ jobs:
run: |
git rev-parse --short HEAD >> ./shortsha
- name: Build amd64
- name: Build amd64
run: |
GOOS=linux GOARCH=amd64 go build -o bin/ddns_amd64_$TAG_VERSION ./cmd/...
export shortsha=`git rev-parse --short HEAD`
GOOS=linux GOARCH=amd64 go build -o bin/ddns_amd64_$TAG_VERSION "-X 'main.Shortsha=$shortsha' -X 'main.Version=$TAG_VERSION' -X 'main.Aarch=amd64'" ./cmd/...
- name: Build arm64
run: |
GOOS=linux GOARCH=arm64 go build -o bin/ddns_arm64_$TAG_VERSION ./cmd/...
GOOS=linux GOARCH=arm64 go build -o bin/ddns_arm64_$TAG_VERSION "-X 'main.Shortsha=$shortsha' -X 'main.Version=$TAG_VERSION' -X 'main.Aarch=arm64'" ./cmd/...
- name: push generic registry amd64
run: |

View File

@ -22,6 +22,9 @@ var (
provider string
rID string
comment string
Version string
Shortsha string
Aarch string
)
func init() {
@ -54,8 +57,8 @@ func main() {
case "prod":
lvl.Set(slog.LevelInfo)
}
log := slog.New(slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: lvl}))
log = log.With("version", Version, "shortsha", Shortsha, "aarch", Aarch)
ctx := context.Background()
helpmsg := "required flag not provided "
if tok == "" {