mirror of
https://github.com/Kizuren/kizuren.dev.git
synced 2026-01-11 17:07:46 +01:00
Removed BuildNDeploy workflow
This commit is contained in:
parent
0eefaf250a
commit
d3f1c4d9e2
1 changed files with 0 additions and 65 deletions
65
.github/workflows/build-and-deploy.yml
vendored
65
.github/workflows/build-and-deploy.yml
vendored
|
|
@ -1,65 +0,0 @@
|
|||
name: Build and Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64, linux/arm64/v8
|
||||
tags: ghcr.io/marcus7i/marcus7i.net:${{ github.ref_name }},ghcr.io/marcus7i/marcus7i.net:latest
|
||||
|
||||
deploy:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: SSH and deploy
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: ${{ secrets.SSH_HOST }}
|
||||
username: ${{ secrets.SSH_USERNAME }}
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
port: ${{ secrets.SSH_PORT }}
|
||||
script: |
|
||||
cd /var/www/marcus7i.net
|
||||
|
||||
# Create .env file with secrets
|
||||
echo "DISCORD_WEBHOOK=${{ secrets.DISCORD_WEBHOOK }}" > .env
|
||||
|
||||
# Pull the latest image
|
||||
docker pull ghcr.io/marcus7i/marcus7i.net:latest
|
||||
|
||||
# Stop and start the container
|
||||
docker compose down
|
||||
docker compose up -d
|
||||
|
||||
# Clean up unused images
|
||||
docker image prune -f
|
||||
Loading…
Add table
Add a link
Reference in a new issue