Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
on:
push:
tags:
- '*'
jobs:
api:
runs-on: ubuntu-latest
environment: dockerhub-push
steps:
- name: Docker login
uses:
- docker/login-action@v2
- docker/setup-buildx-action@v2
- actions/checkout@v3
with:
username: hurtki
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Docker build
run: |
VERSION="${GITHUB_REF_NAME#v}"
docker buildx build --push -t hurtki/github-banners-api:${{ VERSION }} ./api/
renderer:
runs-on: ubuntu-latest
environment: dockerhub-push
steps:
- name: Docker login
uses:
- actions/checkout@v3
- docker/login-action@v2
- docker/setup-buildx-action@v2
with:
username: hurtki
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Docker build
run: |
VERSION="${GITHUB_REF_NAME#v}"
docker buildx build --push -t hurtki/github-banners-renderer:${{ VERSION }} ./renderer/
storage:
runs-on: ubuntu-latest
environment: dockerhub-push
steps:
- name: Docker login
uses:
- actions/checkout@v3
- docker/login-action@v2
- docker/setup-buildx-action@v2
with:
username: hurtki
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Docker build
run: |
VERSION="${GITHUB_REF_NAME#v}"
docker buildx build --push -t hurtki/github-banners-storage:${{ VERSION }} ./storage/
10 changes: 7 additions & 3 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
FROM "golang"
FROM "golang" AS build

WORKDIR /app/renderer/
WORKDIR /app/

COPY go.mod go.sum ./

RUN go mod download

COPY . .

RUN go build -o entry
RUN CGO_ENABLED=0 go build -o entry

RUN chmod u+x entry

EXPOSE 80

FROM alpine:latest

COPY --from=build /app/entry .

CMD ["./entry"]
10 changes: 7 additions & 3 deletions renderer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
FROM "golang"
FROM "golang" AS build

WORKDIR /app/renderer/
WORKDIR /app/

COPY go.mod go.sum ./

RUN go mod download

COPY . .

RUN go build -o entry
RUN CGO_ENABLED=0 go build -o entry

RUN chmod u+x entry

EXPOSE 80

FROM alpine:latest

COPY --from=build /app/entry .

CMD ["./entry"]
10 changes: 7 additions & 3 deletions storage/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
FROM "golang"
FROM "golang" AS build

WORKDIR /app/renderer/
WORKDIR /app/

COPY go.mod go.sum ./

RUN go mod download

COPY . .

RUN go build -o entry
RUN CGO_ENABLED=0 go build -o entry

RUN chmod u+x entry

EXPOSE 80

FROM alpine:latest

COPY --from=build /app/entry .

CMD ["./entry"]
Loading