Skip to content

Commit

Permalink
Merge pull request #45 from gomicro/move-repo
Browse files Browse the repository at this point in the history
Update and move repo
  • Loading branch information
dan9186 authored Oct 17, 2021
2 parents cf90b92 + 0965eaf commit 95c12fd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
fetch-depth: 0

- name: golangci-lint
uses: golangci/golangci-lint-action@v2
Expand All @@ -31,22 +31,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
fetch-depth: 0

- name: Test
run: make test
run: go test ./...

deploy:
name: Deploy
runs-on: ubuntu-latest
needs: [linting, test]
if: startsWith(github.ref, 'refs/tags/')

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:

- name: Install Go
uses: actions/setup-go@v2
with:
Expand All @@ -55,18 +53,22 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
fetch-depth: 0

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install GoReleaser
- name: Snapshot
uses: goreleaser/goreleaser-action@v2
with:
install-only: true
args: release --snapshot

- name: Deploy
run: make deploy
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: goreleaser/goreleaser-action@v2
with:
args: release --rm-dist
10 changes: 3 additions & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@ builds:
- CGO_ENABLED=0

ldflags:
- -X "main.version={{ .Env.VERSION }}"
- -X "main.version={{ .Version }}"
- "-s -w"

goos:
- darwin
- windows
- linux

ignore:
- goos: darwin
goarch: 386

archives:
-
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
Expand All @@ -27,5 +23,5 @@ dockers:
goarch: amd64

image_templates:
- "gomicro/avenues:latest"
- "gomicro/avenues:{{ .Env.VERSION }}"
- "ghcr.io/gomicro/avenues:latest"
- "ghcr.io/gomicro/avenues:{{ .Version }}"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ ca_path: "path to file containing CA(.)(.)" # Optional
Avenues is intended to be used in conjunction with local Docker testing of a service.

```
docker pull gomicro/avenues
docker run -it -v $PWD/routes.yaml:/routes.yaml gomicro/avenues
docker pull ghcr.io/gomicro/avenues
docker run -it -v $PWD/routes.yaml:/routes.yaml ghcr.io/gomicro/avenues
```

# Versioning
Expand Down

0 comments on commit 95c12fd

Please sign in to comment.