From afbc2eea7a20fae84450241db90997e7b9d826aa Mon Sep 17 00:00:00 2001 From: Azis Alvriyanto Date: Wed, 18 Dec 2024 23:17:34 +0700 Subject: [PATCH] build(goreleaser): use vars in github actions --- .github/workflows/release.yml | 2 -- deployments/goreleaser.yml | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f7d8248..78efaac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,5 +48,3 @@ jobs: args: release --clean --config ./deployments/goreleaser.yml env: GITHUB_TOKEN: ${{ secrets.WORKFLOW_GITHUB_TOKEN }} - DOCKERHUB_USERNAME: ${{ vars.DOCKERHUB_USERNAME }} - DOCKERHUB_REPOSITORY: ${{ vars.DOCKERHUB_REPOSITORY }} diff --git a/deployments/goreleaser.yml b/deployments/goreleaser.yml index 6a4538e..386949d 100644 --- a/deployments/goreleaser.yml +++ b/deployments/goreleaser.yml @@ -1,5 +1,5 @@ version: 2 -project_name: ${DOCKERHUB_REPOSITORY} +project_name: ${{ vars.DOCKERHUB_REPOSITORY }} env: - GO111MODULE=on @@ -34,15 +34,15 @@ archives: dockers: - image_templates: - - "docker.io/${DOCKERHUB_USERNAME}/{{ .ProjectName }}:{{ .Tag }}-amd64" + - "docker.io/${{ vars.DOCKERHUB_USERNAME }}/{{ .ProjectName }}:{{ .Tag }}-amd64" use: buildx dockerfile: ./deployments/Dockerfile build_flag_templates: - "--platform=linux/amd64" - image_templates: - - "docker.io/${DOCKERHUB_USERNAME}/{{ .ProjectName }}:{{ .Tag }}-arm64" - - "docker.io/${DOCKERHUB_USERNAME}/{{ .ProjectName }}:latest" + - "docker.io/${{ vars.DOCKERHUB_USERNAME }}/{{ .ProjectName }}:{{ .Tag }}-arm64" + - "docker.io/${{ vars.DOCKERHUB_USERNAME }}/{{ .ProjectName }}:latest" use: buildx dockerfile: ./deployments/Dockerfile goarch: arm64 @@ -50,14 +50,14 @@ dockers: - --platform=linux/arm64/v8 docker_manifests: - - name_template: "docker.io/${DOCKERHUB_USERNAME}/{{ .ProjectName }}:{{ .Tag }}" + - name_template: "docker.io/${{ vars.DOCKERHUB_USERNAME }}/{{ .ProjectName }}:{{ .Tag }}" image_templates: - - "docker.io/${DOCKERHUB_USERNAME}/{{ .ProjectName }}:{{ .Tag }}-amd64" - - "docker.io/${DOCKERHUB_USERNAME}/{{ .ProjectName }}:{{ .Tag }}-arm64" - - name_template: "docker.io/${DOCKERHUB_USERNAME}/{{ .ProjectName }}:latest" + - "docker.io/${{ vars.DOCKERHUB_USERNAME }}/{{ .ProjectName }}:{{ .Tag }}-amd64" + - "docker.io/${{ vars.DOCKERHUB_USERNAME }}/{{ .ProjectName }}:{{ .Tag }}-arm64" + - name_template: "docker.io/${{ vars.DOCKERHUB_USERNAME }}/{{ .ProjectName }}:latest" image_templates: - - "docker.io/${DOCKERHUB_USERNAME}/{{ .ProjectName }}:{{ .Tag }}-amd64" - - "docker.io/${DOCKERHUB_USERNAME}/{{ .ProjectName }}:{{ .Tag }}-arm64" + - "docker.io/${{ vars.DOCKERHUB_USERNAME }}/{{ .ProjectName }}:{{ .Tag }}-amd64" + - "docker.io/${{ vars.DOCKERHUB_USERNAME }}/{{ .ProjectName }}:{{ .Tag }}-arm64" changelog: sort: asc