Skip to content

Commit b9df2f3

Browse files
authored
Merge pull request #3 from utmstack/feature/adding_deployment_actions
Updating deployment actions
2 parents 8747c61 + 321c222 commit b9df2f3

File tree

3 files changed

+63
-68
lines changed

3 files changed

+63
-68
lines changed

.github/workflows/main.yaml

Lines changed: 0 additions & 66 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Filebrowser docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
tags: [ 'v*' ]
8+
pull_request:
9+
branches:
10+
- 'master'
11+
12+
jobs:
13+
generate-filebrowser-image:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Determine Build Environment
17+
id: set-env
18+
run: |
19+
if ${{ github.event_name == 'push' && github.ref_name != 'master' }}; then
20+
echo "DEV environment"
21+
echo "ENV_VERSION=v10-dev" >> $GITHUB_ENV
22+
elif ${{ github.event_name == 'pull_request' && github.base_ref == 'master' }}; then
23+
echo "QA environment"
24+
echo "ENV_VERSION=v10-qa" >> $GITHUB_ENV
25+
elif ${{ github.event_name == 'push' && github.ref_name == 'master'}}; then
26+
echo "RC environment"
27+
echo "ENV_VERSION=v10-rc" >> $GITHUB_ENV
28+
elif ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}; then
29+
echo "PROD environment"
30+
echo "ENV_VERSION=v10" >> $GITHUB_ENV
31+
fi
32+
- name: Check out code into the right branch
33+
uses: actions/checkout@v4
34+
- uses: actions/setup-node@v2
35+
with:
36+
node-version: '14'
37+
- name: Set up QEMU
38+
uses: docker/setup-qemu-action@v1
39+
- name: Build frontend
40+
run: make build-frontend
41+
- name: Set up Go 1.x
42+
uses: actions/setup-go@v4
43+
with:
44+
go-version: ^1.20
45+
id: go
46+
- name: Build Binary
47+
run: go build -o "filebrowser" -v .
48+
- name: Login to GitHub Container Registry
49+
uses: docker/login-action@v3
50+
with:
51+
registry: ghcr.io
52+
username: utmstack
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: Build and Push the Image
56+
uses: docker/build-push-action@v5
57+
with:
58+
context: .
59+
push: true
60+
tags: ghcr.io/utmstack/filebrowser/filebrowser:${{ env.ENV_VERSION }}
61+

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ RUN apt install -y ca-certificates sendmail curl
55
HEALTHCHECK --start-period=2s --interval=5s --timeout=3s \
66
CMD curl -f http://localhost:9091/health || exit 1
77

8-
VOLUME /srv
9-
108
COPY .docker.json /.filebrowser.json
119
COPY filebrowser /filebrowser
1210
COPY run.sh /run.sh
1311

12+
RUN chmod +x /run.sh
13+
1414
ENTRYPOINT [ "/run.sh" ]

0 commit comments

Comments
 (0)