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