Merge pull request #65 from marcelGoerentz/development #32
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: Threadfin Build | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
buildBinaries: | |
name: Build and release binaries | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
outputs: | |
new_version: ${{ steps.set-build-number.outputs.new_version }} | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
with: | |
ref: maser | |
- name: Set build number | |
id: set-build-number | |
run: | | |
bash ${GITHUB_WORKSPACE}/Utility/set_build_number.sh ${{ vars.BUILD_NUMBER }} | |
- name: Update repo variable | |
run: | | |
bash ${GITHUB_WORKSPACE}/Utility/update_build_number_variable.sh ${{ secrets.API_TOKEN }} ${{ github.repository }} ${{ env.NEW_BUILD }} | |
- name: Build webUI | |
run: | | |
tsc -p ${GITHUB_WORKSPACE}/web/tsconfig.json | |
python ${GITHUB_WORKSPACE}/Utility/create_new_webUI.py | |
- name: Upload webUI as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: webUI-artifact | |
path: ./src/webUI.go | |
- name: Set up and Build | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23 | |
id: go | |
- name: Build binaries | |
run: | | |
go mod tidy && go mod vendor | |
bash ${GITHUB_WORKSPACE}/Utility/create_binaries.sh | |
- name: Create a Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
token: "${{ secrets.GITHUB_TOKEN }}" | |
files: dist/* | |
name: v${{ env.NEW_VERSION }} | |
tag_name: v${{ env.NEW_VERSION }} | |
make_latest: true | |
buildDockerImages: | |
name: Build and push Docker images | |
runs-on: ubuntu-latest | |
needs: buildBinaries | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set NEW_VERSION | |
run: echo "NEW_VERSION=${{ needs.buildBinaries.outputs.new_version }}" >> $GITHUB_ENV | |
shell: bash | |
- name: Download webUI artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: webUI-artifact | |
path: ./src | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Docker Build and Push | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
no-cache: true | |
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8 | |
tags: | | |
mgoerentz/threadfin:latest | |
mgoerentz/threadfin:v${{ env.NEW_VERSION }} |