alefvanoon пре 3 година
родитељ
комит
b4626c377c
1 измењених фајлова са 38 додато и 0 уклоњено
  1. 38 0
      .github/workflows/image-publish.yml

+ 38 - 0
.github/workflows/image-publish.yml

@@ -0,0 +1,38 @@
+name: Build and Deploy to github packages
+on:
+  workflow_dispatch:
+    inputs:
+      target:
+        description: 'Target Branch, tag or SHA'
+        required: true
+        default: 'main'
+
+jobs:
+  buildx:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+
+      - name: Set up QEMU
+        uses: docker/setup-qemu-action@v1
+      - name: Set up Docker Buildx
+        id: buildx
+        uses: docker/setup-buildx-action@v1
+      - name: Login to GitHub Container Registry
+        uses: docker/login-action@v1
+        with:
+          registry: ghcr.io
+          username: ${{ github.repository_owner }}
+          password: ${{ secrets.GHCR_TOKEN }}
+      - name: Build and push
+        uses: docker/build-push-action@v2
+        with:
+          context: .
+          platforms: linux/amd64,linux/arm64
+          push: true
+          tags: |
+            ghcr.io/${{ github.repository_owner }}/libremdb:latest
+            ghcr.io/${{ github.repository_owner }}/libremdb:${{ github.event.inputs.target }}
+          cache-from: type=registry,ref=user/app:latest
+          cache-to: type=inline