├── .dockerignore
├── .github
└── workflows
│ └── deploy_site.yaml
├── .gitignore
├── .idea
├── .gitignore
├── golang-insiders-com.iml
├── modules.xml
└── vcs.xml
├── Dockerfile
├── README.md
├── cmd
└── site
│ └── main.go
├── fly.toml
├── go.mod
└── public
└── index.html
/.dockerignore:
--------------------------------------------------------------------------------
1 | # flyctl launch added from .gitignore
2 | .encore
3 |
4 | # flyctl launch added from .idea/.gitignore
5 | # Default ignored files
6 | .idea/shelf
7 | .idea/workspace.xml
8 | # Editor-based HTTP Client requests
9 | .idea/httpRequests
10 | # Datasource local storage ignored files
11 | .idea/dataSources
12 | .idea/dataSources.local.xml
13 | fly.toml
14 |
--------------------------------------------------------------------------------
/.github/workflows/deploy_site.yaml:
--------------------------------------------------------------------------------
1 | name: Fly Deploy Site
2 | on:
3 | push:
4 | branches:
5 | - main
6 | jobs:
7 | deploy:
8 | name: Deploy Site
9 | runs-on: ubuntu-latest
10 | steps:
11 | - uses: actions/checkout@v3
12 | - uses: superfly/flyctl-actions/setup-flyctl@master
13 | - run: flyctl deploy --remote-only
14 | env:
15 | FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
16 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /.encore
2 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 | # Datasource local storage ignored files
7 | /dataSources/
8 | /dataSources.local.xml
9 |
--------------------------------------------------------------------------------
/.idea/golang-insiders-com.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | # Use the official Golang image as a parent image
2 | FROM golang:latest
3 |
4 | # Set the working directory inside the container
5 | WORKDIR /app
6 |
7 | # Copy the Go Modules manifests
8 | COPY go.mod ./
9 | # Download Go modules
10 | RUN go mod download
11 |
12 | # Copy the source code into the container
13 | COPY cmd/ ./cmd/
14 | COPY public/ ./public/
15 |
16 | # Build the application
17 | RUN go build -o /myapp cmd/site/main.go
18 |
19 | # Expose port 3000
20 | EXPOSE 3000
21 |
22 | # Run the binary program
23 | CMD ["/myapp"]
24 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Golang Inisiders Site
2 |
3 | [](https://github.com/Golang-Insiders/site/actions/workflows/deploy_site.yaml)
4 |
5 |
6 |
--------------------------------------------------------------------------------
/cmd/site/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "log"
5 | "net/http"
6 | )
7 |
8 | func main() {
9 | http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
10 | http.ServeFile(w, r, "./public/index.html")
11 | })
12 | if err := http.ListenAndServe(":3000", nil); err != nil {
13 | log.Fatal("failed to serve home page.")
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/fly.toml:
--------------------------------------------------------------------------------
1 | # fly.toml app configuration file generated for golang-insiders-com on 2023-11-14T20:46:52Z
2 | #
3 | # See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4 | #
5 |
6 | app = "golang-insiders-com"
7 | primary_region = "lhr"
8 |
9 | [build]
10 |
11 | [http_service]
12 | internal_port = 3000
13 | force_https = true
14 | min_machines_running = 0
15 | processes = ["app"]
16 |
--------------------------------------------------------------------------------
/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/golang-insiders/site
2 |
3 | go 1.21
4 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 | Join the communnity here
2 |
3 | If you can read this, CI/CD now works too.
4 |
--------------------------------------------------------------------------------