-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add working docker and github action maybe?
- Loading branch information
Showing
4 changed files
with
80 additions
and
8 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,45 @@ | ||
name: Docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- v*.*.* | ||
|
||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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,21 @@ | ||
FROM golang AS build | ||
|
||
WORKDIR /build | ||
|
||
COPY go.mod go.sum ./ | ||
|
||
RUN go mod download && go mod verify | ||
|
||
COPY . . | ||
|
||
RUN go build -v -o app | ||
|
||
FROM photon | ||
|
||
WORKDIR /data | ||
|
||
COPY ./web/static web/static | ||
COPY ./web/templates web/templates | ||
COPY --from=build /build/app /usr/local/bin | ||
|
||
ENTRYPOINT ["app"] |
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,12 +1,18 @@ | ||
module github.com/zorchenhimer/MoviePolls | ||
|
||
go 1.13 | ||
go 1.23.4 | ||
|
||
require ( | ||
github.com/go-sql-driver/mysql v1.4.1 | ||
github.com/gorilla/sessions v1.2.0 | ||
github.com/mitchellh/mapstructure v1.3.3 | ||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 | ||
github.com/rivo/uniseg v0.1.0 | ||
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 | ||
) | ||
|
||
require ( | ||
github.com/golang/protobuf v1.4.2 // indirect | ||
github.com/gorilla/securecookie v1.1.1 // indirect | ||
golang.org/x/net v0.0.0-20200822124328-c89045814202 // indirect | ||
google.golang.org/appengine v1.6.6 // indirect | ||
google.golang.org/protobuf v1.25.0 // indirect | ||
) |
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