Skip to content

Commit

Permalink
add code
Browse files Browse the repository at this point in the history
  • Loading branch information
untitledds committed Nov 30, 2024
1 parent 43594d3 commit ea541c7
Show file tree
Hide file tree
Showing 11 changed files with 979 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Docker Image CI

on:
push:
branches:
- dev
- master
tags:
- "*.*.*"
pull_request:
branches:
- dev

jobs:
build:
name: Build and Push Docker images
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Docker meta backend image
id: meta-back
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/untitledds/taiga-back
flavor: |
suffix=-access
tags: |
type=raw,value=latest,enable=${{ github.ref_type == 'tag' }}
type=semver,pattern={{raw}},enable=${{ github.ref_type == 'tag' }}
type=ref,event=pr
type=ref,event=branch,enable=${{ github.ref_name == 'dev' }},value=dev
type=ref,event=branch,enable=${{ github.ref_name == 'master' }},value=latest
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push backend image
uses: docker/build-push-action@v5
with:
file: Dockerfile.back
push: true
tags: ${{ steps.meta-back.outputs.tags }}
platforms: linux/amd64

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push backend image with cache
uses: docker/build-push-action@v5
with:
file: Dockerfile.back
push: true
tags: ${{ steps.meta-back.outputs.tags }}
platforms: linux/amd64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM taigaio/taiga-back:6.8.1

# Копируем и устанавливаем плагин для аутентификации по токену доступа
COPY --chown=taiga:taiga ./back /tmp/taiga-contrib-access-token-auth
RUN pip install /tmp/taiga-contrib-access-token-auth && \
rm -rf /tmp/taiga-contrib-access-token-auth

# Копируем настройки и добавляем их в config.py
COPY --chown=taiga:taiga ./config.snippet.py ./urls.py /taiga-back/settings/
RUN cat /taiga-back/settings/config.snippet.py >> /taiga-back/settings/config.py
4 changes: 4 additions & 0 deletions back/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
__pycache__
*.egg-info
dist
.eggs/
Loading

0 comments on commit ea541c7

Please sign in to comment.