ci/cd
This commit is contained in:
43
.gitea/workflows/build-and-deploy.yml
Normal file
43
.gitea/workflows/build-and-deploy.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Build and Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Gitea Registry
|
||||
run: |
|
||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | \
|
||||
docker login http://192.168.2.2:30008 -u ${{ secrets.REGISTRY_USER }} --password-stdin
|
||||
|
||||
- name: Build Image
|
||||
run: docker build -t gitea.johannesbot.de/JohannesBOT/stupid-apis:latest .
|
||||
|
||||
- name: Push Image
|
||||
run: docker push gitea.johannesbot.de/JohannesBOT/stupid-apis:latest
|
||||
|
||||
# deploy:
|
||||
# runs-on: ubuntu-latest
|
||||
# needs: build
|
||||
# steps:
|
||||
# - name: Deploy via SSH
|
||||
# run: |
|
||||
# mkdir -p ~/.ssh
|
||||
# echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||
# chmod 600 ~/.ssh/id_ed25519
|
||||
# ssh-keyscan -H ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts
|
||||
#
|
||||
# ssh -i ~/.ssh/id_ed25519 ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} << 'EOF'
|
||||
# cd /opt/myapp
|
||||
# docker compose pull
|
||||
# docker compose up -d
|
||||
# EOF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user