-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Build and Push Docker Image to GHCR | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Login to GHCR | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
tags: ghcr.io/${{ github.repository }}:latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
|
||
FROM denoland/deno:alpine-1.23.1 | ||
|
||
EXPOSE 8000 | ||
|
||
# Use the official Golang image as the base image | ||
FROM golang:1.21-alpine as builder | ||
WORKDIR /app | ||
|
||
COPY deps.ts . | ||
COPY . . | ||
RUN go build ./cmd/redirect | ||
|
||
RUN deno cache deps.ts | ||
RUN deno cache main.ts | ||
# Use slim alpine image for production | ||
FROM alpine:3.18 as production | ||
WORKDIR /app | ||
COPY --from=builder /app/redirect . | ||
EXPOSE 3000 | ||
|
||
CMD ["run", "-A", "main.ts"] | ||
# Run the Go program when the container starts | ||
CMD ["./redirect"] |
38f63b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed to deploy: