Skip to content

enhance: set default value of envs according to README.md's Bot sec… #107

enhance: set default value of envs according to README.md's Bot sec…

enhance: set default value of envs according to README.md's Bot sec… #107

Workflow file for this run

name: Go test and build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test_and_build:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.23
cache: true
- name: Test
run: go test -v ./...
- name: Build Linux
run: GOOS=linux GARCH=amd64 CGO_ENABLED=0 go build -v -o bin/factorigo-chat-bot
- name: Build Windows
run: GOOS=windows GARCH=amd64 CGO_ENABLED=0 go build -v -o bin/factorigo-chat-bot.exe
- name: Upload Unix binary
uses: actions/upload-artifact@v3
with:
name: factoriogo-chat-bot
path: ./bin/factorigo-chat-bot
- name: Upload Windows binary
uses: actions/upload-artifact@v3
with:
name: factoriogo-chat-bot.exe
path: ./bin/factorigo-chat-bot.exe
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: mattie112/factorigo-chat-bot
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: ${{ github.event_name == 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- run: echo "🍏 This job's status is ${{ job.status }}."