-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
Showing
2 changed files
with
31 additions
and
31 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 |
---|---|---|
|
@@ -9,37 +9,45 @@ jobs: | |
publish: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
timeout-minutes: 20 | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: 📦 Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-go@v4 | ||
|
||
- uses: docker/login-action@v2 | ||
- name: 🚧️ Make release | ||
uses: goreleaser/goreleaser-action@v4 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
username: ${{ secrets.DOCKER_LOGIN }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
version: latest | ||
args: release --clean | ||
|
||
- name: 🧪 Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- uses: docker/login-action@v2 | ||
- name: 🔒 Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Prepare Env Vars | ||
run: | | ||
echo GHCR_USER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV | ||
# Publish a new release from git tag. | ||
- uses: goreleaser/[email protected] | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
- name: 🏗️ Build container and push | ||
uses: docker/build-push-action@v4 | ||
env: | ||
DOCKERHUB_USER: ${{ secrets.DOCKER_LOGIN }} | ||
GHCR_USER: ${{ env.GHCR_USER }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TAG: ${{ github.ref_name }} | ||
COMMIT: ${{ github.sha }} | ||
with: | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:v${{ github.ref_name }} |
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