Skip to content

Commit

Permalink
update release file
Browse files Browse the repository at this point in the history
  • Loading branch information
academo committed Nov 26, 2024
1 parent 007113e commit 7b84173
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
# .github/workflows/release.yaml

on:
release:
types: [created]

jobs:
# release-linux-amd64:
# name: release linux/amd64
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: wangyoucao577/[email protected]
# with:
# pre_command: export CGO_ENABLED=0
# github_token: ${{ secrets.DEPLOY_TOKEN }}
# goos: linux
# goarch: amd64
# goversion: 1.20.1
# binary_name: grafana-ntfy
# project_path: ./pkg/
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
Expand Down
19 changes: 8 additions & 11 deletions Magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,17 @@ func Deploy() error {
return err
}
// build docker image
err = sh.Run("docker", "build", "-t", "academo/grafana-ntfy:"+version, ".")
// Replace with these commands for multi-platform build:
err = sh.Run("docker", "buildx", "create", "--use", "--if-not-exists") // Create and use buildx builder
if err != nil {
return err
}
err = sh.Run("docker", "tag", "academo/grafana-ntfy:"+version, "academo/grafana-ntfy:latest")
if err != nil {
return err
}
// push docker image
err = sh.Run("docker", "push", "academo/grafana-ntfy:"+version)
if err != nil {
return err
}
err = sh.Run("docker", "push", "academo/grafana-ntfy:latest")
err = sh.Run("docker", "buildx", "build",
"--platform", "linux/amd64,linux/arm64", // Build for both AMD64 and ARM64
"-t", "academo/grafana-ntfy:"+version,
"-t", "academo/grafana-ntfy:latest",
"--push", // Push all tags at once
".")
if err != nil {
return err
}
Expand Down

0 comments on commit 7b84173

Please sign in to comment.