Skip to content

Commit

Permalink
feat: Publish docker image to github registry
Browse files Browse the repository at this point in the history
  • Loading branch information
NoUseFreak committed Dec 9, 2021
1 parent eb07f6d commit 91f85cc
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,41 @@ jobs:
goversion: "https://golang.org/dl/go1.17.3.linux-amd64.tar.gz"
extra_files: LICENSE README.md smtprelay.ini
ldflags: -s -w -X "main.appVersion=${{ env.APP_VERSION }}" -X "main.buildTime=${{ env.BUILD_TIME }}"

docker_release:
name: Docker release
runs-on: ubuntu-latest
steps:
- name: Checkout Current
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}},value=${{ env.APP_VERSION }}
type=semver,pattern={{major}}.{{minor}},value=${{ env.APP_VERSION }}
type=semver,pattern={{major}},value=${{ env.APP_VERSION }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha

0 comments on commit 91f85cc

Please sign in to comment.