/api/raw reconstruction #1001
This file contains hidden or 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: Update Server | |
on: | |
workflow_dispatch: | |
inputs: | |
tags: | |
description: 'Release Tags' | |
push: | |
branches: | |
- "main" | |
- "dev" | |
- "test" | |
tags: | |
- 'v*' | |
jobs: | |
update_server: | |
runs-on: ubuntu-latest | |
steps: | |
- name: PR Conventional Commit Validation | |
uses: ytanikin/[email protected] | |
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' | |
with: | |
task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert","style"]' | |
add_label: 'true' | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:qemu-v8.1.5 | |
cache-image: false | |
platforms: arm64 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: 1.23.3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASS }} | |
- name: get latest tag | |
uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
id: get-latest-tag | |
with: | |
fallback: test # latest | |
# - name: Build | |
# run: cd packages/backend/;go mod tidy;export CGO_ENABLED=0;make build-backend;ls | |
- name: Build | |
run: | | |
go mod tidy | |
cd cmd/backend | |
for GOOS in linux; do | |
for GOARCH in amd64 arm64; do | |
export GOOS=$GOOS | |
export GOARCH=$GOARCH | |
go build -o filebrowser main.go | |
mkdir -p dist/$GOOS-$GOARCH | |
mv filebrowser dist/$GOOS-$GOARCH/ | |
done | |
done | |
- name: Build and push | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: Dockerfile | |
push: true | |
# tags: beclab/files-server:${{ github.event.inputs.tags }} | |
tags: beclab/files-server:${{ steps.get-latest-tag.outputs.tag }} | |
platforms: linux/amd64,linux/arm64 |