-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
43594d3
commit ea541c7
Showing
11 changed files
with
979 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
__pycache__ | ||
*.egg-info | ||
dist | ||
.eggs/ |
Oops, something went wrong.