birdbot/.github/workflows/publish_release.yaml

50 lines
1.3 KiB
YAML
Raw Normal View History

2022-10-27 04:22:28 +02:00
name: Publish
on:
release:
types:
- created
workflow_dispatch: {}
jobs:
publish:
name: Build & Publish
2023-04-03 05:49:28 +02:00
runs-on: ubuntu-20.04
2022-10-27 04:22:28 +02:00
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.20'
2022-10-27 04:22:28 +02:00
- name: Version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Test
run: |
make test
- name: Build
run: |
make build VERSION="${{ env.RELEASE_VERSION }}"
2022-10-30 04:57:28 +01:00
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
2023-06-19 09:14:42 +02:00
draft: false
2022-10-30 04:57:28 +01:00
files: |
build/birdbot
sample_config.yaml
2022-10-27 04:22:28 +02:00
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: yeslayla/birdbot:latest,yeslayla/birdbot:${{ env.RELEASE_VERSION }}