filebrowser/.github/workflows/main.yaml

72 lines
2.2 KiB
YAML
Raw Permalink Normal View History

2024-08-24 22:02:33 +00:00
name: main release
2021-03-04 00:21:05 +00:00
on:
push:
branches:
2024-08-04 14:56:18 +00:00
- "main"
2023-09-25 01:03:09 +00:00
2021-03-04 00:21:05 +00:00
jobs:
2025-02-17 16:51:16 +00:00
test_playwright:
2025-01-13 00:50:22 +00:00
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: .
2025-02-17 16:56:46 +00:00
file: ./_docker/Dockerfile.playwright-regular
2025-01-13 00:50:22 +00:00
push: false
push_latest_to_registry:
2025-02-17 16:51:16 +00:00
needs: [ test_playwright ]
name: Push latest
runs-on: ubuntu-latest
2021-03-04 00:21:05 +00:00
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
2025-01-13 00:50:22 +00:00
- name: Find latest beta tag
2024-09-16 21:01:16 +00:00
run: |
2025-01-13 00:55:13 +00:00
echo "LATEST_TAG=$(git describe --tags $(git rev-list --tags="*-beta*" --max-count=1))" >> $GITHUB_ENV
2024-09-16 21:01:16 +00:00
echo "latest tag is $LATEST_TAG"
2021-03-04 00:21:05 +00:00
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.0.0
2021-03-04 00:21:05 +00:00
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.0.0
- name: Login to Docker Hub
uses: docker/login-action@v3
2021-03-04 00:21:05 +00:00
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
2024-07-30 17:45:27 +00:00
uses: docker/metadata-action@v5
with:
images: gtstef/filebrowser
- name: Build and push
uses: docker/build-push-action@v5
2021-03-04 00:21:05 +00:00
with:
context: .
2024-08-24 22:02:33 +00:00
build-args: |
2024-09-16 21:01:16 +00:00
VERSION=${{ env.LATEST_TAG }}
2024-08-24 22:02:33 +00:00
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
2025-01-31 20:26:21 +00:00
file: ./_docker/Dockerfile
push: true
tags: 'gtstef/filebrowser:latest'
labels: ${{ steps.meta.outputs.labels }}