-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: ditch buggy repository dispatch action
- Loading branch information
Showing
2 changed files
with
75 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |
This file was deleted.
Oops, something went wrong.