Skip to content

Commit

Permalink
Merge branch 'master' into 465-neviditelné-první-písmenko-pod-názvem-…
Browse files Browse the repository at this point in the history
…akce-ve-veřejné-sekci
  • Loading branch information
SmallhillCZ committed Jan 28, 2024
2 parents 3f20b16 + 079aa9f commit 0dba4c7
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 17 deletions.
4 changes: 3 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ RUN apk add --no-cache alpine-sdk python3
RUN npm i -g @angular/cli @nestjs/cli

# set up git
RUN git config --global --add safe.directory /workspace && git config --global core.autocrlf true
RUN git config --global --add safe.directory /workspace && git config --global core.autocrlf true

CMD /bin/sh -c "while sleep 1000; do :; done"
4 changes: 2 additions & 2 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: bosan_web_development

services:
devcontainer:
container_name: ${COMPOSE_PROJECT_NAME:-bosan-web-dev}-devcontainer
build: "."
command: /bin/sh -c "while sleep 1000; do :; done"
user: node
volumes:
- ..:/workspace:cached
24 changes: 17 additions & 7 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- ".github/workflows/deploy-production.yml"

jobs:
build-docker:
build:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
Expand All @@ -19,19 +19,29 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to docker.bosan.cz registry
- name: Login to container registry
uses: docker/login-action@v2
with:
registry: docker.bosan.cz
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image and push it to the docker.bosan.cz repository
- name: Build image and push it to the container repository
uses: docker/build-push-action@v4
with:
build-args: NG_CONFIGURATION=production
push: true
context: .
tags: "docker.bosan.cz/web:latest"
tags: "ghcr.io/bosancz/web:latest"
cache-from: type=gha
cache-to: type=gha,mode=max

deploy:
needs: build
runs-on: ubuntu-latest # Run the job on an Ubuntu runner
steps:
- name: Call Watchtower to Update Docker Image
run: |
curl -I --fail-with-body \
-H "Authorization: Bearer ${{ secrets.WATCHTOWER_TOKEN }}" \
${{ vars.WATCHTOWER_URL }}
24 changes: 17 additions & 7 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [opened, reopened, ready_for_review, synchronize]

jobs:
build-docker:
build:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
Expand All @@ -15,19 +15,29 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to docker.bosan.cz registry
- name: Login to container registry
uses: docker/login-action@v2
with:
registry: docker.bosan.cz
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image and push it to the docker.bosan.cz repository
- name: Build image and push it to the container registry
uses: docker/build-push-action@v4
with:
build-args: NG_CONFIGURATION=test
push: true
context: .
tags: "docker.bosan.cz/web:test"
tags: "ghcr.io/bosancz/web:test"
cache-from: type=gha
cache-to: type=gha,mode=max

deploy:
needs: build
runs-on: ubuntu-latest # Run the job on an Ubuntu runner
steps:
- name: Call Watchtower to Update Docker Image
run: |
curl -I --fail-with-body \
-H "Authorization: Bearer ${{ secrets.WATCHTOWER_TOKEN }}" \
${{ vars.WATCHTOWER_URL }}

0 comments on commit 0dba4c7

Please sign in to comment.