Skip to content

Commit cc78d31

Browse files
author
Graham Steffaniak
committed
updated workflow
1 parent 8e8eadb commit cc78d31

File tree

4 files changed

+156
-9
lines changed

4 files changed

+156
-9
lines changed

.github/workflows/dev.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: dev
2+
3+
on:
4+
push:
5+
branches:
6+
- 'dev_v*'
7+
8+
jobs:
9+
test-backend:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-go@v4
14+
with:
15+
go-version: 1.22.0
16+
- run: cd backend && go test -race -v ./...
17+
lint-backend:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: actions/setup-go@v4
22+
with:
23+
go-version: 1.22.0
24+
- run: go install github.com/golangci/golangci-lint/cmd/[email protected]
25+
- run: cd backend && golangci-lint run
26+
format-backend:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v3
30+
- uses: actions/setup-go@v4
31+
with:
32+
go-version: 1.22.0
33+
- run: cd backend && go fmt ./...
34+
lint-frontend:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v2
38+
- uses: actions/setup-node@v2
39+
with:
40+
node-version: '21'
41+
- run: cd frontend && npm i eslint
42+
- run: cd frontend && npm run lint
43+
push_dev_to_registry:
44+
name: Push dev image
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v4
49+
- name: Set up QEMU
50+
uses: docker/[email protected]
51+
- name: Set up Docker Buildx
52+
uses: docker/[email protected]
53+
# Workaround to fix error:
54+
# failed to push: failed to copy: io: read/write on closed pipe
55+
# See https://github.com/docker/build-push-action/issues/761
56+
with:
57+
driver-opts: |
58+
image=moby/buildkit:v0.10.6
59+
- name: Login to Docker Hub
60+
uses: docker/login-action@v3
61+
with:
62+
username: ${{ secrets.DOCKERHUB_USERNAME }}
63+
password: ${{ secrets.DOCKERHUB_TOKEN }}
64+
- name: Extract metadata (tags, labels) for Docker
65+
id: meta
66+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
67+
with:
68+
images: gtstef/filebrowser
69+
- name: Build and push
70+
uses: docker/build-push-action@v5
71+
with:
72+
context: .
73+
file: ./Dockerfile
74+
push: true
75+
tags: ${{ steps.meta.outputs.tags }}
76+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/main.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ jobs:
1212
- uses: actions/checkout@v3
1313
- uses: actions/setup-go@v4
1414
with:
15-
go-version: 1.21.1
15+
go-version: 1.22.0
1616
- run: cd backend && go test -race -v ./...
1717
lint-backend:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- uses: actions/checkout@v3
2121
- uses: actions/setup-go@v4
2222
with:
23-
go-version: 1.21.1
23+
go-version: 1.22.0
2424
- run: go install github.com/golangci/golangci-lint/cmd/[email protected]
2525
- run: cd backend && golangci-lint run
2626
format-backend:
@@ -29,15 +29,15 @@ jobs:
2929
- uses: actions/checkout@v3
3030
- uses: actions/setup-go@v4
3131
with:
32-
go-version: 1.21.1
32+
go-version: 1.22.0
3333
- run: cd backend && go fmt ./...
3434
lint-frontend:
3535
runs-on: ubuntu-latest
3636
steps:
3737
- uses: actions/checkout@v2
3838
- uses: actions/setup-node@v2
3939
with:
40-
node-version: '20'
40+
node-version: '21'
4141
- run: cd frontend && npm i eslint
4242
- run: cd frontend && npm run lint
4343

.github/workflows/pr-merge.yaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55
branches:
66
- 'main'
7+
- 'dev_v*'
78
- 'v[0-9]+.[0-9]+.[0-9]+'
89

910
jobs:
@@ -13,19 +14,36 @@ jobs:
1314
- uses: actions/checkout@v3
1415
- uses: actions/setup-go@v4
1516
with:
16-
go-version: 1.21.1
17+
go-version: 1.22.0
1718
- run: cd backend && go test -race -v ./...
19+
lint-backend:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
- uses: actions/setup-go@v4
24+
with:
25+
go-version: 1.22.0
26+
- run: go install github.com/golangci/golangci-lint/cmd/[email protected]
27+
- run: cd backend && golangci-lint run
1828
format-backend:
1929
runs-on: ubuntu-latest
2030
steps:
2131
- uses: actions/checkout@v3
2232
- uses: actions/setup-go@v4
2333
with:
24-
go-version: 1.21.1
34+
go-version: 1.22.0
2535
- run: cd backend && go fmt ./...
36+
lint-frontend:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v2
40+
- uses: actions/setup-node@v2
41+
with:
42+
node-version: '21'
43+
- run: cd frontend && npm i eslint
44+
- run: cd frontend && npm run lint
2645

2746
push_pr_to_registry:
28-
needs: [test-backend, format-backend]
2947
name: Push PR
3048
runs-on: ubuntu-latest
3149
steps:

.github/workflows/release.yaml

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,70 @@ on:
44
push:
55
branches:
66
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
8+
permissions:
9+
contents: write
10+
711
jobs:
12+
create_release:
13+
name: Create Release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
- name: Extract branch name
19+
shell: bash
20+
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
21+
id: extract_branch
22+
- name: Create Release
23+
id: create_release
24+
uses: actions/create-release@v1
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
with:
28+
tag_name: ${{ steps.extract_branch.outputs.branch }}
29+
release_name: ${{ steps.extract_branch.outputs.branch }}
30+
body: |
31+
Please see usage on [readme](https://github.com/gtsteffaniak/filebrowser).
32+
Docker repo: https://hub.docker.com/r/gtstef/filebrowser/tags
33+
draft: false
34+
prerelease: false
35+
test-backend:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v3
39+
- uses: actions/setup-go@v4
40+
with:
41+
go-version: 1.22.0
42+
- run: cd backend && go test -race -v ./...
43+
lint-backend:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v3
47+
- uses: actions/setup-go@v4
48+
with:
49+
go-version: 1.22.0
50+
- run: go install github.com/golangci/golangci-lint/cmd/[email protected]
51+
- run: cd backend && golangci-lint run
852
format-backend:
953
runs-on: ubuntu-latest
1054
steps:
1155
- uses: actions/checkout@v3
1256
- uses: actions/setup-go@v4
1357
with:
14-
go-version: 1.21.1
58+
go-version: 1.22.0
1559
- run: cd backend && go fmt ./...
60+
lint-frontend:
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v2
64+
- uses: actions/setup-node@v2
65+
with:
66+
node-version: '21'
67+
- run: cd frontend && npm i eslint
68+
- run: cd frontend && npm run lint
1669
push_release_to_registry:
17-
needs: [format-backend]
70+
needs: [lint-frontend, lint-backend, test-backend, format-backend]
1871
name: Push release
1972
runs-on: ubuntu-latest
2073
steps:

0 commit comments

Comments
 (0)