Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
chore: Build and push docker (#29)
Browse files Browse the repository at this point in the history
- Separate action for docker
  • Loading branch information
amalshaji authored Feb 24, 2023
1 parent 852c291 commit e019e28
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 30 deletions.
49 changes: 39 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,50 @@ jobs:
npm i -g pnpm
pnpm install --dir internal/server/web --frozen-lockfile && pnpm run --dir internal/server/web build
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: amalshaji
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Publish packages
uses: goreleaser/goreleaser-action@v4
with:
# either 'goreleaser' (default) or 'goreleaser-pro':
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro'
# distribution:
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
amalshaji/beaver
tags: |
type=semver,pattern={{version}}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: amalshaji
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: |
linux/amd64
linux/arm64
file: deployments/Dockerfile
20 changes: 0 additions & 20 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,3 @@ brews:
commit_author:
name: Amal Shaji
email: [email protected]

dockers:
- image_templates:
- "amalshaji/beaver:{{ .Version }}-amd64"
use: buildx
dockerfile: deployments/Dockerfile
build_flag_templates:
- "--platform=linux/amd64"
- image_templates:
- "amalshaji/beaver:{{ .Version }}-arm64"
use: buildx
goarch: arm64
dockerfile: deployments/Dockerfile
build_flag_templates:
- "--platform=linux/arm64"
docker_manifests:
- name_template: "amalshaji/beaver:{{ .Version }}"
image_templates:
- "amalshaji/beaver:{{ .Version }}-amd64"
- "amalshaji/beaver:{{ .Version }}-arm64"

0 comments on commit e019e28

Please sign in to comment.