-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e70bde3
commit 5ba39e5
Showing
2 changed files
with
29 additions
and
72 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: Go | ||
on: [push, pull_request] | ||
on: [ push, pull_request ] | ||
jobs: | ||
|
||
build: | ||
|
@@ -17,6 +17,10 @@ jobs: | |
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Unshallow | ||
if: success() && startsWith(github.ref, 'refs/tags/v') | ||
run: git fetch --prune --unshallow | ||
|
||
- name: Cache go module | ||
uses: actions/cache@v2 | ||
with: | ||
|
@@ -34,24 +38,27 @@ jobs: | |
name: Docker Build, Tag, Push | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Docker Login Github | ||
if: github.ref == 'refs/heads/master' | ||
run: >- | ||
echo "${{ secrets.GITHUB_TOKEN }}" | ||
| docker login -u ${GITHUB_ACTOR} --password-stdin docker.pkg.github.com | ||
- name: Build | ||
if: github.ref == 'refs/heads/master' | ||
run: docker build -t docker.pkg.github.com/${GITHUB_REPOSITORY}/${GITHUB_REPOSITORY#*/}:latest . | ||
|
||
- name: Publish Latest to GitHub Package Registry | ||
if: github.ref == 'refs/heads/master' | ||
run: docker push docker.pkg.github.com/${GITHUB_REPOSITORY}/${GITHUB_REPOSITORY#*/}:latest | ||
|
||
- name: Clear | ||
if: always() && github.ref == 'refs/heads/master' | ||
run: | | ||
rm -f ${HOME}/.docker/config.json | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Docker Login | ||
if: success() && startsWith(github.ref, 'refs/tags/v') | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
run: | | ||
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin | ||
- name: GoReleaser | ||
uses: goreleaser/[email protected] | ||
if: success() | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
|
||
- name: Clear | ||
if: always() | ||
run: | | ||
rm -f ${HOME}/.docker/config.json |
This file was deleted.
Oops, something went wrong.