Skip to content

Commit

Permalink
feat: release github action
Browse files Browse the repository at this point in the history
  • Loading branch information
julienc91 committed Sep 7, 2024
1 parent dc5dc46 commit df0ebda
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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_PACKAGE_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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Tests
on:
push:
branches:
Expand Down
1 change: 1 addition & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit df0ebda

Please sign in to comment.