Skip to content

Commit

Permalink
feat(deploy): minor improvments (#38)
Browse files Browse the repository at this point in the history
Co-authored-by: leoguillaume <[email protected]>
  • Loading branch information
leoguillaume and leoguillaumegouv authored Oct 11, 2024
1 parent c9f21a4 commit 926a7f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ on:
push:
branches:
- main
- staging
- dev

jobs:
build-and-push:
if: github.ref_name == 'dev'
name: Build and push from ${{ github.ref_name }}/${{ github.sha }}
runs-on: ubuntu-latest
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
APP_IMAGE_NAME: ghcr.io/${{ github.repository }}/app
UI_IMAGE_NAME: ghcr.io/${{ github.repository }}/ui
IMAGE_TAG: ${{ github.sha }}
steps:
- name: Checkout repository
Expand All @@ -35,7 +34,7 @@ jobs:
context: .
file: ./app/Dockerfile
push: true
tags: ${{ env.IMAGE_NAME }}/app:${{ env.IMAGE_TAG }},${{ env.IMAGE_NAME }}/app:latest
tags: ${{ env.APP_IMAGE_NAME }}:${{ env.IMAGE_TAG }},${{ env.APP_IMAGE_NAME }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max

Expand All @@ -45,7 +44,7 @@ jobs:
context: .
file: ./ui/Dockerfile
push: true
tags: ${{ env.IMAGE_NAME }}/ui:${{ env.IMAGE_TAG }},${{ env.IMAGE_NAME }}/ui:latest
tags: ${{ env.UI_IMAGE_NAME }}:${{ env.IMAGE_TAG }},${{ env.UI_IMAGE_NAME }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max

Expand Down
2 changes: 0 additions & 2 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM python:3.12-slim

RUN apt-get update && apt-get install -y libmagic1 libmagic-dev

RUN groupadd --gid 1100 albert
RUN useradd --home /home/albert --gid 1100 --uid 1100 albert
USER albert
Expand Down

0 comments on commit 926a7f5

Please sign in to comment.