Skip to content

Build and Push Executable #4

Build and Push Executable

Build and Push Executable #4

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 -m "Add executable" || echo "No changes to commit"
git push origin exec