diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3f8129e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: Release +on: + workflow_dispatch: + inputs: + dryRun: + description: 'Dry Run' + required: true + default: 'true' + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + strategy: + fail-fast: false + matrix: + include: + - dockerfile: ./backend/Dockerfile + image: ghcr.io/julienc91/caviardeul-backend + - dockerfile: ./frontend/Dockerfile + image: ghcr.io/julienc91/caviardeul-frontend + steps: + - uses: actions/checkout@v4 + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ matrix.image }} + - name: Build and push image + uses: docker/build-push-action@v6 + with: + context: . + file: ${{ matrix.dockerfile }} + push: ${{ github.event.inputs.dryRun != 'true' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + prod: prod diff --git a/.github/workflows/main.yml b/.github/workflows/tests.yml similarity index 99% rename from .github/workflows/main.yml rename to .github/workflows/tests.yml index 4176160..92ceb0e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: CI +name: Tests on: push: branches: diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 4901eb4..7e6e345 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -23,6 +23,7 @@ FROM base AS build_prod WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . +ARG NEXT_PUBLIC_BASE_URL=https://caviardeul.fr RUN yarn build FROM base AS prod