name: Build and Upload Binary
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
# Run your build step here (example: compiling a Go project)
- name: Build project
run: |
make build # adjust to your build command
ls -la # list files to ensure the binary exists
# Upload the binary back to the main branch
- name: Upload binary
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "actions@github.com"
git add path/to/your/binary
git commit -m "Add binary"
git push origin main
upload-binary.yml