CI Test
Some checks failed
Some checks failed
This commit is contained in:
@@ -4,7 +4,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
# Optional: führe auch bei Tag-Releases ein Deployment durch
|
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
@@ -18,7 +17,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Docker client
|
- name: Install Docker client
|
||||||
run: |
|
run: |
|
||||||
apk add --no-cache docker-cli bash
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y docker.io bash
|
||||||
|
|
||||||
- name: Build Docker Image
|
- name: Build Docker Image
|
||||||
run: |
|
run: |
|
||||||
@@ -40,13 +40,15 @@ jobs:
|
|||||||
|
|
||||||
- name: Push Image
|
- name: Push Image
|
||||||
run: |
|
run: |
|
||||||
apk add --no-cache bash docker-cli
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y docker.io bash
|
||||||
cd docker
|
cd docker
|
||||||
chmod +x ./push-to-gitea.sh
|
chmod +x ./push-to-gitea.sh
|
||||||
export GITEA_REGISTRY="${{ env.GITEA_REGISTRY }}"
|
export GITEA_REGISTRY="${{ env.GITEA_REGISTRY }}"
|
||||||
export GITEA_USER="${{ secrets.CI_REGISTRY_USER }}"
|
export GITEA_USER="${{ secrets.CI_REGISTRY_USER }}"
|
||||||
export GITEA_TOKEN="${{ secrets.CI_REGISTRY_PASSWORD }}"
|
export GITEA_TOKEN="${{ secrets.CI_REGISTRY_PASSWORD }}"
|
||||||
./push-to-gitea.sh "${{ env.IMAGE_NAME }}" "${{ env.TAG }}"
|
./push-to-gitea.sh "${{ env.IMAGE_NAME }}" "${{ env.TAG }}"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE_NAME: angular-web-app
|
IMAGE_NAME: angular-web-app
|
||||||
TAG: ${{ github.ref_name == 'main' && 'latest' || github.ref_name }}
|
TAG: ${{ github.ref_name == 'main' && 'latest' || github.ref_name }}
|
||||||
@@ -59,7 +61,9 @@ jobs:
|
|||||||
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
|
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare environment
|
- name: Prepare environment
|
||||||
run: apk add --no-cache openssh-client docker-cli
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y openssh-client docker.io
|
||||||
|
|
||||||
- name: Deploy via SSH
|
- name: Deploy via SSH
|
||||||
run: |
|
run: |
|
||||||
@@ -75,15 +79,10 @@ jobs:
|
|||||||
docker run -d --name angular-web-app -p 80:80 gitea.moz-tech.de/${{ secrets.CI_REGISTRY_USER }}/angular-web-app:latest
|
docker run -d --name angular-web-app -p 80:80 gitea.moz-tech.de/${{ secrets.CI_REGISTRY_USER }}/angular-web-app:latest
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# deploy-prod:
|
|
||||||
# if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
# deploy-staging:
|
|
||||||
# if: github.ref == 'refs/heads/dev'
|
|
||||||
|
|
||||||
# notify:
|
# notify:
|
||||||
# name: 🔔 Notify Deployment Result
|
# name: 🔔 Notify Deployment Result
|
||||||
# runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
# needs: [ deploy ]
|
# needs: deploy
|
||||||
# if: always()
|
# if: always()
|
||||||
# steps:
|
# steps:
|
||||||
# - name: Send Discord Notification
|
# - name: Send Discord Notification
|
||||||
@@ -94,3 +93,8 @@ jobs:
|
|||||||
# -X POST \
|
# -X POST \
|
||||||
# -d "{\"content\": \"${MESSAGE}\"}" \
|
# -d "{\"content\": \"${MESSAGE}\"}" \
|
||||||
# ${{ secrets.DISCORD_WEBHOOK_URL }}
|
# ${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||||
|
|
||||||
|
# deploy-prod:
|
||||||
|
# if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
# deploy-staging:
|
||||||
|
# if: github.ref == 'refs/heads/dev'
|
||||||
|
|||||||
Reference in New Issue
Block a user