Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize #9

Merged
merged 9 commits into from
Jul 7, 2024
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
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Push Docker Image

on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- created
workflow_dispatch:

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

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

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: |
bacherik/killedby:${{ github.event_name == 'push' && 'latest' || github.event_name == 'release' && github.event.release.tag_name || 'pr-' }}${{ github.event.pull_request.number || '' }}

- name: Logout from DockerHub
run: docker logout
40 changes: 0 additions & 40 deletions .github/workflows/deploy.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
output/
cache/

# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
Expand Down
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Use an official Golang runtime as a parent image
FROM golang:1.22.4-alpine

# Set the working directory inside the container
WORKDIR /app

# Copy the go.mod and go.sum files into the working directory
COPY go.mod go.sum ./

# Install dependencies
RUN go mod download

# Copy the entire project and build it
COPY . .

# Build the Go app
RUN go build -o /killedby

# Expose port 8080 to the outside world
EXPOSE 8080

# Command to run the executable
CMD ["/killedby"]
19 changes: 0 additions & 19 deletions assets/css/custom.css

This file was deleted.

Binary file removed assets/img/BachErik.png
Binary file not shown.
65 changes: 0 additions & 65 deletions companies/BachErik.json

This file was deleted.

Loading