fixup! feat: add presigned download url #81
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: Publish to docker | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| artifact_name: bilirec | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| branches: | |
| - '*' | |
| paths: | |
| - '**/*.go' | |
| - 'Dockerfile' | |
| workflow_dispatch: | |
| jobs: | |
| test_program: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| - name: Install ffmpeg | |
| uses: FedericoCarboni/setup-ffmpeg@v3 | |
| - name: Install swag | |
| run: go install github.com/swaggo/swag/cmd/swag@v1.16.6 | |
| - name: Add GOPATH bin to PATH | |
| run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
| - name: Generate swagger docs | |
| run: swag init -g internal/modules/rest/rest.go -o docs | |
| - name: Install dependencies | |
| run: | | |
| go mod download | |
| - name: Run tests | |
| id: test | |
| continue-on-error: true | |
| uses: robherley/go-test-action@v0 | |
| publish_docker: | |
| needs: [ test_program ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| docker.io/${{ secrets.DOCKER_USERNAME }}/${{ env.artifact_name }} | |
| tags: | | |
| type=edge | |
| type=sha,event=branch | |
| type=ref,event=tag | |
| - name: Build and push | |
| id: docker_build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| platforms: linux/arm64/v8, linux/amd64 | |
| cache-from: type=registry,ref=docker.io/${{ secrets.DOCKER_USERNAME }}/${{ env.artifact_name }}:cache | |
| cache-to: type=registry,ref=docker.io/${{ secrets.DOCKER_USERNAME }}/${{ env.artifact_name }}:cache,mode=max |