diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml new file mode 100644 index 0000000..3c8250c --- /dev/null +++ b/.github/workflows/ci-backend.yml @@ -0,0 +1,38 @@ +name: Build & Publish Backend + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create image name + id: image_name + run: echo "IMAGE_NAME=ghcr.io/$(echo "${{ github.repository }}-backend" | tr '[:upper:]' '[:lower:]')" > "$GITHUB_ENV" + + # create a unique tag for each build for debugging + - name: Set Docker tag + id: date + run: echo "DATE_STAMP=$(date +%s)" > "$GITHUB_ENV" + + - name: Build and push Docker images + uses: iloveitaly/github-action-nixpacks@main + with: + context: './src/backend' + push: true + tags: | + ${{ env.IMAGE_NAME }}:sha-${{ env.DATE_STAMP }} + ${{ env.IMAGE_NAME }}:latest \ No newline at end of file diff --git a/.github/workflows/ci-frontend.yml b/.github/workflows/ci-frontend.yml new file mode 100644 index 0000000..dcb42d2 --- /dev/null +++ b/.github/workflows/ci-frontend.yml @@ -0,0 +1,38 @@ +name: Build & Publish Frontend + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create image name + id: image_name + run: echo "IMAGE_NAME=ghcr.io/$(echo "${{ github.repository }}-frontend" | tr '[:upper:]' '[:lower:]')" > "$GITHUB_ENV" + + # create a unique tag for each build for debugging + - name: Set Docker tag + id: date + run: echo "DATE_STAMP=$(date +%s)" > "$GITHUB_ENV" + + - name: Build and push Docker images + uses: iloveitaly/github-action-nixpacks@main + with: + context: './src/frontend' + push: true + tags: | + ${{ env.IMAGE_NAME }}:sha-${{ env.DATE_STAMP }} + ${{ env.IMAGE_NAME }}:latest \ No newline at end of file diff --git a/src/backend/.cargo/config.toml b/src/backend/.cargo/config.toml deleted file mode 100644 index 5474bc4..0000000 --- a/src/backend/.cargo/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -[build] -rustflags = ["-Ctarget-cpu=native"] \ No newline at end of file