Skip to content

Commit 6b48ba3

Browse files
authored
Merge pull request #1 from flarexio/feature/github-actions
Feature/GitHub actions
2 parents ba6f520 + 0761724 commit 6b48ba3

7 files changed

Lines changed: 97 additions & 154 deletions

File tree

.drone.yml

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

.github/workflows/build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: ['*']
6+
pull_request:
7+
branches: ['*']
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-backend:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version: '1.24'
20+
21+
- name: Build
22+
run: go build cmd/wallet/main.go
23+
24+
- name: Test
25+
run: go test -v ./...

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release-linux-amd64:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Log in to Docker Hub
15+
uses: docker/login-action@v3
16+
with:
17+
username: ${{ secrets.REGISTRY_USERNAME }}
18+
password: ${{ secrets.REGISTRY_PASSWORD }}
19+
20+
- name: Build and Push Frontend Image
21+
uses: docker/build-push-action@v6
22+
with:
23+
context: .
24+
file: build/Dockerfile.frontend.linux.amd64
25+
push: true
26+
tags: flarexio/wallet-app:${{ github.ref_name }}-linux-amd64
27+
28+
- name: Build and Push Backend Image
29+
uses: docker/build-push-action@v6
30+
with:
31+
context: .
32+
file: build/Dockerfile.backend.linux.amd64
33+
push: true
34+
tags: flarexio/wallet:${{ github.ref_name }}-linux-amd64
35+
36+
release-manifest:
37+
runs-on: ubuntu-latest
38+
needs: release-linux-amd64
39+
steps:
40+
- name: Log in to Docker Hub
41+
uses: docker/login-action@v3
42+
with:
43+
username: ${{ secrets.REGISTRY_USERNAME }}
44+
password: ${{ secrets.REGISTRY_PASSWORD }}
45+
46+
- name: Create and Push Frontend Manifest
47+
run: |
48+
docker manifest create flarexio/wallet-app:${{ github.ref_name }} \
49+
flarexio/wallet-app:${{ github.ref_name }}-linux-amd64
50+
docker manifest push flarexio/wallet-app:${{ github.ref_name }}
51+
52+
- name: Create and Push Backend Manifest
53+
run: |
54+
docker manifest create flarexio/wallet:${{ github.ref_name }} \
55+
flarexio/wallet:${{ github.ref_name }}-linux-amd64
56+
docker manifest push flarexio/wallet:${{ github.ref_name }}
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
FROM golang:1.24-alpine AS builder
2+
RUN apk add --no-cache git
3+
WORKDIR /src
4+
COPY . .
5+
RUN CGO_ENABLED=0 go build -o /wallet cmd/wallet/main.go
6+
17
FROM alpine:3.22
8+
COPY --from=builder /wallet /bin/wallet
29
EXPOSE 8080
3-
ADD release/linux/amd64/wallet /bin/
4-
ENTRYPOINT ["/bin/wallet"]
10+
ENTRYPOINT ["/bin/wallet"]
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
FROM node:20-alpine AS builder
2+
WORKDIR /src/app
3+
COPY app/ .
4+
RUN npm install
5+
RUN npx ng build
6+
17
FROM caddy:2.10.0-alpine
2-
ADD build/Caddyfile /etc/caddy/Caddyfile
3-
ADD app/dist/app /app/
8+
COPY build/Caddyfile /etc/caddy/Caddyfile
9+
COPY --from=builder /src/app/dist/app /app/
410
EXPOSE 80

build/manifest.backend.txt

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

build/manifest.frontend.txt

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

0 commit comments

Comments
 (0)