Improve image building actions
@@ -2,7 +2,7 @@ name: Test
on:
push:
- branches: ["*"]
+ branches: ["feature/git-actions"]
jobs:
test:
@@ -36,11 +36,11 @@ jobs:
go test -covermode=count -coverprofile=coverage.out ./...
goveralls -coverprofile=coverage.out -service=circle-ci -ignore=models/ -repotoken ${{ secrets.COVERALLS_TOKEN }}
- publish:
- name: Publish
+ publish-image:
+ name: Release Docker Image
runs-on: ubuntu-latest
needs: test
- if: github.ref == 'refs/heads/master'
+ if: github.ref == 'refs/heads/master' || 'refs/heads/dev'
steps:
- name: Checkout
uses: actions/checkout@v2
@@ -51,18 +51,13 @@ jobs:
go-version: ^1.13
id: go
- - 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: ${{ secrets.AWS_DEFAULT_REGION }}
-
- run: curl -sLO https://git.io/goreleaser && chmod +x goreleaser
- run: go get -u github.com/gobuffalo/packr/v2/packr2
- run: ./goreleaser --rm-dist --snapshot
- - name: Build Docker image
+ - name: Release Production Docker Image
+ if: github.ref == 'refs/heads/feature/git-actions'
+ # if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
@@ -70,40 +65,13 @@ jobs:
repository: lbry/lbrytv
tags: latest
tag_with_ref: true
- push: ${{ startsWith(github.ref, 'refs/tags/') }}
- publish-dev:
- name: Publish Dev
- runs-on: ubuntu-latest
- needs: test
- if: github.ref == 'refs/heads/dev'
- steps:
- - name: Checkout
- uses: actions/checkout@v2
-
- - name: Set up Go 1.x
- uses: actions/setup-go@v2
- with:
- go-version: ^1.13
- id: go
-
- - 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: ${{ secrets.AWS_DEFAULT_REGION }}
-
- - run: curl -sLO https://git.io/goreleaser && chmod +x goreleaser
- - run: go get -u github.com/gobuffalo/packr/v2/packr2
- - run: ./goreleaser --rm-dist --snapshot
-
- - name: Build Docker image
+ - name: Release Dev Docker Image
+ if: github.ref == 'refs/heads/feature/git-actions'
+ # if: github.ref == 'refs/heads/dev'
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: lbry/lbrytv
tags: latest-dev
- tag_with_ref: true
- push: ${{ startsWith(github.ref, 'refs/tags/') }}
