Skip to content

Commit

Permalink
added api build
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Jackson committed Aug 26, 2024
1 parent 1846eb5 commit 5347de1
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 2 deletions.
70 changes: 68 additions & 2 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
ghcr.io/wizedkyle/artifactsmmo/woodcutting:1.0.${{ github.run_id }}
build-fishing-image:
name: Build Woodcutting Image
name: Build Fishing Image
runs-on: ubuntu-latest
permissions:
packages: write
Expand Down Expand Up @@ -136,4 +136,70 @@ jobs:
platforms: linux/amd64
tags: |
ghcr.io/wizedkyle/artifactsmmo/fishing:latest
ghcr.io/wizedkyle/artifactsmmo/fishing:1.0.${{ github.run_id }}
ghcr.io/wizedkyle/artifactsmmo/fishing:1.0.${{ github.run_id }}
build-worker-image:
name: Build Worker Image
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup QEMU
uses: docker/setup-qemu-action@v3

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Azure Container Registry
uses: docker/login-action@v3
with:
registry: "ghcr.io"
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push image
uses: docker/build-push-action@v5
with:
context: .
push: true
file: build/worker/Dockerfile
platforms: linux/amd64
tags: |
ghcr.io/wizedkyle/artifactsmmo/worker:latest
ghcr.io/wizedkyle/artifactsmmo/worker:1.0.${{ github.run_id }}
build-api-image:
name: Build API Image
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup QEMU
uses: docker/setup-qemu-action@v3

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Azure Container Registry
uses: docker/login-action@v3
with:
registry: "ghcr.io"
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push image
uses: docker/build-push-action@v5
with:
context: .
push: true
file: build/api/Dockerfile
platforms: linux/amd64
tags: |
ghcr.io/wizedkyle/artifactsmmo/api:latest
ghcr.io/wizedkyle/artifactsmmo/api:1.0.${{ github.run_id }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ go.work.sum

# env file
.env

tmp/*
14 changes: 14 additions & 0 deletions build/api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM golang:1.22.5-alpine3.20

ENV PORT=9000

WORKDIR /go/src/api

COPY . /go/src/api

RUN go get ./...
RUN go build ./cmd/api

EXPOSE $PORT

ENTRYPOINT ["./api"]

0 comments on commit 5347de1

Please sign in to comment.