commit
68a02e2f24
@ -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
|
||||
COPY ./go.mod .
|
||||
COPY ./go.sum .
|
||||
|
||||
RUN apk add --no-cache git
|
||||
|
||||
RUN go get -d -v ./...
|
||||
RUN go mod download
|
||||
|
||||
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
|
||||
|
||||
import (
|
||||
"djpianalto.com/goff/djpianalto.com/goff/utils"
|
||||
"fmt"
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"log"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"github.com/dustinpianalto/goff/utils"
|
||||
)
|
||||
|
||||
func OnGuildMemberAddLogging(s *discordgo.Session, member *discordgo.GuildMemberAdd) {
|
||||
@ -1,15 +1,16 @@
|
||||
package exts
|
||||
|
||||
import (
|
||||
"djpianalto.com/goff/djpianalto.com/goff/utils"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/dustinpianalto/disgoman"
|
||||
"github.com/dustinpianalto/goff/utils"
|
||||
"github.com/olebedev/when"
|
||||
"github.com/olebedev/when/rules/common"
|
||||
"github.com/olebedev/when/rules/en"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func addReminderCommand(ctx disgoman.Context, args []string) {
|
||||
@ -1,13 +1,14 @@
|
||||
package exts
|
||||
|
||||
import (
|
||||
"djpianalto.com/goff/djpianalto.com/goff/utils"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"github.com/dustinpianalto/disgoman"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"github.com/dustinpianalto/disgoman"
|
||||
"github.com/dustinpianalto/goff/utils"
|
||||
)
|
||||
|
||||
func kickUserCommand(ctx disgoman.Context, args []string) {
|
||||
@ -1,14 +1,15 @@
|
||||
package exts
|
||||
|
||||
import (
|
||||
"djpianalto.com/goff/djpianalto.com/goff/utils"
|
||||
"fmt"
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"github.com/dustinpianalto/disgoman"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"github.com/dustinpianalto/disgoman"
|
||||
"github.com/dustinpianalto/goff/utils"
|
||||
)
|
||||
|
||||
func pingCommand(ctx disgoman.Context, _ []string) {
|
||||
Loading…
Reference in new issue