Skip to content

Commit

Permalink
ci: fix docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
pmb0 committed Sep 9, 2024
1 parent fda8ce8 commit 0c9282f
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 48 deletions.
5 changes: 5 additions & 0 deletions .changeset/blue-suns-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@embetty/server': patch
---

docker setup
48 changes: 0 additions & 48 deletions .github/workflows/docker.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,49 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

publish-docker:
name: Publish Docker Images
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.published == 'true'
strategy:
fail-fast: true
matrix:
package: ${{ fromJson(needs.release.outputs.publishedPackages) }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: heiseonline/embetty-server
tags: |
type=ref,event=branch
type=semver,pattern={{version}},value=${{ matrix.package.version }}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
${{ github.ref == 'refs/heads/master' && 'type=raw,value=latest' || '' }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/arm64/v8,linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 0c9282f

Please sign in to comment.