72 lines
2.2 KiB
YAML
72 lines
2.2 KiB
YAML
name: main release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "main"
|
|
|
|
jobs:
|
|
test_playwright:
|
|
name: Test Playwright
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3.0.0
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3.0.0
|
|
- uses: actions/setup-node@v4
|
|
- working-directory: frontend
|
|
run: npm i && npm run build
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 'stable'
|
|
- working-directory: backend
|
|
run: go build -o filebrowser .
|
|
- name: Build
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./_docker/Dockerfile.playwright-regular
|
|
push: false
|
|
push_latest_to_registry:
|
|
needs: [ test_playwright ]
|
|
name: Push latest
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Find latest beta tag
|
|
run: |
|
|
echo "LATEST_TAG=$(git describe --tags $(git rev-list --tags="*-beta*" --max-count=1))" >> $GITHUB_ENV
|
|
echo "latest tag is $LATEST_TAG"
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3.0.0
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3.0.0
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: gtstef/filebrowser
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
build-args: |
|
|
VERSION=${{ env.LATEST_TAG }}
|
|
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
file: ./_docker/Dockerfile
|
|
push: true
|
|
tags: 'gtstef/filebrowser:latest'
|
|
labels: ${{ steps.meta.outputs.labels }}
|