Merge pull request #30 from Dodai-Dodai/rmsome #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Push Executable | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21' # Goのバージョンを指定 | |
- name: Build executable | |
run: go build -o main . | |
- name: Configure Git | |
run: | | |
git config user.name "github-actions" | |
git config user.email "[email protected]" | |
- name: Check out the exec branch | |
run: git checkout -b exec || git checkout exec | |
- name: Add executable | |
run: | | |
git add main | |
git commit --allow-empty -m "Add executable" || echo "No changes to commit" | |
git push origin exec |