Skip to content

Commit

Permalink
ci: ditch buggy repository dispatch action
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmoraes committed Nov 14, 2020
1 parent 7535931 commit 70f6a27
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 88 deletions.
80 changes: 75 additions & 5 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,83 @@ jobs:
--mount type=bind,source=${GITHUB_WORKSPACE},target=/usr/src,consistency=cached
sonarsource/sonar-scanner-cli
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
trigger-release:
release-go:
runs-on: ubuntu-latest
needs: [build,lint,test]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: dispatch release
uses: peter-evans/repository-dispatch@v1
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: setup golang
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: set golang environment variables
run: |
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV
- name: cache modules
uses: actions/cache@v2
with:
path: ${GOMODCACHE}
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('go.sum') }}
${{ runner.os }}-modules-${{ env.cache-name }}-
${{ runner.os }}-modules-
${{ runner.os }}-
- name: cache vendor
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-vendor-${{ env.cache-name }}-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-vendor-${{ env.cache-name }}-${{ hashFiles('go.sum') }}
${{ runner.os }}-vendor-${{ env.cache-name }}-
${{ runner.os }}-vendor-
${{ runner.os }}-
- name: cache build
uses: actions/cache@v2
with:
path: ${HOME}/.cache/go-build
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('go.sum') }}
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: run goreleaser
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-docker:
runs-on: ubuntu-latest
needs: [build,lint,test]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: checkout
uses: actions/checkout@v2
- name: build and publish image
uses: docker/build-push-action@v2
env:
DOCKER_BUILDKIT: 1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ${{ github.repository }}
build_args: BUILDKIT_INLINE_CACHE=1
tags: latest
add_git_labels: true
cache-to: type=inline
cache_from: type=registry,ref=${{ github.repository }}:latest
- name: update docker hub description
uses: meeDamian/[email protected]
with:
token: ${{ secrets.GITHUB_PAT }}
event-type: release
pass: ${{ secrets.DOCKER_PASSWORD }}
description: true
83 changes: 0 additions & 83 deletions .github/workflows/release.yml

This file was deleted.

0 comments on commit 70f6a27

Please sign in to comment.