diff --git a/.gitea/workflows/backend-image.yml b/.gitea/workflows/backend-image.yml new file mode 100644 index 0000000..35eb3ac --- /dev/null +++ b/.gitea/workflows/backend-image.yml @@ -0,0 +1,41 @@ +name: Backend Image + +on: + push: + branches: [main] + tags: ["v*.*.*"] + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Log in to registry + uses: docker/login-action@v3 + with: + registry: ${{ vars.REGISTRY }} + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ vars.REGISTRY }}/${{ github.repository_owner }}/apicore-backend + tags: | + type=raw,value=latest,enable={{is_default_branch}} + type=sha,format=short + type=semver,pattern={{version}} + + - name: Set up Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: ./ApiCore-Backend + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitea/workflows/frontend-image.yml b/.gitea/workflows/frontend-image.yml new file mode 100644 index 0000000..f58d528 --- /dev/null +++ b/.gitea/workflows/frontend-image.yml @@ -0,0 +1,43 @@ +name: Frontend Image + +on: + push: + branches: [main] + tags: ["v*.*.*"] + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Log in to registry + uses: docker/login-action@v3 + with: + registry: ${{ vars.REGISTRY }} + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ vars.REGISTRY }}/${{ github.repository_owner }}/apicore-frontend + tags: | + type=raw,value=latest,enable={{is_default_branch}} + type=sha,format=short + type=semver,pattern={{version}} + + - name: Set up Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: ./ApiCore-Frontend + push: true + build-args: | + NEXT_PUBLIC_API_URL=${{ vars.NEXT_PUBLIC_API_URL }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}