Merge pull request #2 from dustinpianalto/development

Adding actions and reorg
development
DustyP 5 years ago committed by GitHub
commit 68a02e2f24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,44 @@
name: CI
# Controls when the action will run. Triggers the workflow on push to master or development
# with a tag like v1.0.0 or v1.0.0-dev
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-[a-zA-Z]+
jobs:
build:
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Get Version
id: get_version
uses: battila7/get-version-action@v2.0.0
- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: goff
IMAGE_TAG: ${{ steps.get_version.outputs.version-without-v }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest

@ -1,13 +1,20 @@
FROM golang:1.14-alpine FROM golang:1.14-alpine as dev
WORKDIR /go/src/Goff WORKDIR /go/src/Goff
COPY ./go.mod . COPY ./go.mod .
COPY ./go.sum .
RUN apk add --no-cache git RUN go mod download
RUN go get -d -v ./...
COPY . . COPY . .
RUN go install -v ./... RUN go install github.com/dustinpianalto/goff
CMD [ "go", "run", "goff.go"]
from alpine
WORKDIR /bin
COPY --from=dev /go/bin/goff ./goff
ENTRYPOINT /go/bin/goff CMD [ "goff" ]

@ -1,12 +1,13 @@
package events package events
import ( import (
"djpianalto.com/goff/djpianalto.com/goff/utils"
"fmt" "fmt"
"github.com/bwmarrin/discordgo"
"log" "log"
"strconv" "strconv"
"time" "time"
"github.com/bwmarrin/discordgo"
"github.com/dustinpianalto/goff/utils"
) )
func OnGuildMemberAddLogging(s *discordgo.Session, member *discordgo.GuildMemberAdd) { func OnGuildMemberAddLogging(s *discordgo.Session, member *discordgo.GuildMemberAdd) {

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"log" "log"
"djpianalto.com/goff/djpianalto.com/goff/utils"
"github.com/bwmarrin/discordgo" "github.com/bwmarrin/discordgo"
"github.com/dustinpianalto/goff/utils"
) )
func OnMessageUpdate(session *discordgo.Session, m *discordgo.MessageUpdate) { func OnMessageUpdate(session *discordgo.Session, m *discordgo.MessageUpdate) {

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"strings" "strings"
"djpianalto.com/goff/djpianalto.com/goff/utils"
"github.com/dustinpianalto/disgoman" "github.com/dustinpianalto/disgoman"
"github.com/dustinpianalto/goff/utils"
) )
// Guild management commands // Guild management commands

@ -6,8 +6,8 @@ import (
"log" "log"
"strings" "strings"
"djpianalto.com/goff/djpianalto.com/goff/utils"
"github.com/dustinpianalto/disgoman" "github.com/dustinpianalto/disgoman"
"github.com/dustinpianalto/goff/utils"
"github.com/kballard/go-shellquote" "github.com/kballard/go-shellquote"
) )

@ -1,15 +1,16 @@
package exts package exts
import ( import (
"djpianalto.com/goff/djpianalto.com/goff/utils"
"errors" "errors"
"fmt" "fmt"
"strings"
"time"
"github.com/dustinpianalto/disgoman" "github.com/dustinpianalto/disgoman"
"github.com/dustinpianalto/goff/utils"
"github.com/olebedev/when" "github.com/olebedev/when"
"github.com/olebedev/when/rules/common" "github.com/olebedev/when/rules/common"
"github.com/olebedev/when/rules/en" "github.com/olebedev/when/rules/en"
"strings"
"time"
) )
func addReminderCommand(ctx disgoman.Context, args []string) { func addReminderCommand(ctx disgoman.Context, args []string) {

@ -1,13 +1,14 @@
package exts package exts
import ( import (
"djpianalto.com/goff/djpianalto.com/goff/utils"
"errors" "errors"
"fmt" "fmt"
"github.com/bwmarrin/discordgo"
"github.com/dustinpianalto/disgoman"
"strings" "strings"
"time" "time"
"github.com/bwmarrin/discordgo"
"github.com/dustinpianalto/disgoman"
"github.com/dustinpianalto/goff/utils"
) )
func kickUserCommand(ctx disgoman.Context, args []string) { func kickUserCommand(ctx disgoman.Context, args []string) {

@ -1,14 +1,15 @@
package exts package exts
import ( import (
"djpianalto.com/goff/djpianalto.com/goff/utils"
"fmt" "fmt"
"github.com/bwmarrin/discordgo"
"github.com/dustinpianalto/disgoman"
"sort" "sort"
"strconv" "strconv"
"strings" "strings"
"time" "time"
"github.com/bwmarrin/discordgo"
"github.com/dustinpianalto/disgoman"
"github.com/dustinpianalto/goff/utils"
) )
func pingCommand(ctx disgoman.Context, _ []string) { func pingCommand(ctx disgoman.Context, _ []string) {

@ -1,13 +1,13 @@
module djpianalto.com/goff module github.com/dustinpianalto/goff
go 1.14 go 1.14
require ( require (
github.com/bwmarrin/discordgo v0.20.3-0.20200525154655-ca64123b05de github.com/bwmarrin/discordgo v0.20.3-0.20200525154655-ca64123b05de
github.com/dustinpianalto/disgoman v0.0.10 github.com/dustinpianalto/disgoman v0.0.10
github.com/dustinpianalto/rpnparse v1.0.1
github.com/emersion/go-imap v1.0.5 github.com/emersion/go-imap v1.0.5
github.com/emersion/go-message v0.12.0 github.com/emersion/go-message v0.12.0
github.com/dustinpianalto/rpnparse v1.0.1
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/lib/pq v1.3.0 github.com/lib/pq v1.3.0
github.com/olebedev/when v0.0.0-20190311101825-c3b538a97254 github.com/olebedev/when v0.0.0-20190311101825-c3b538a97254

@ -4,10 +4,10 @@ import (
"fmt" "fmt"
"log" "log"
"djpianalto.com/goff/djpianalto.com/goff/events"
"djpianalto.com/goff/djpianalto.com/goff/exts"
"djpianalto.com/goff/djpianalto.com/goff/utils"
"github.com/dustinpianalto/disgoman" "github.com/dustinpianalto/disgoman"
"github.com/dustinpianalto/goff/events"
"github.com/dustinpianalto/goff/exts"
"github.com/dustinpianalto/goff/utils"
//"github.com/MikeModder/anpan" //"github.com/MikeModder/anpan"
"os" "os"
Loading…
Cancel
Save