From f40e8c638c7e78810911c18e24483a0a8c7a2df9 Mon Sep 17 00:00:00 2001 From: jamesratcliffe101 Date: Thu, 4 Jun 2026 20:31:07 +0100 Subject: [PATCH] test login-action --- .gitea/workflows/deploy.yml | 35 +------------------------ deploy.yml.bak | 52 +++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 34 deletions(-) create mode 100644 deploy.yml.bak diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 70c0b83..547287a 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -2,9 +2,7 @@ name: Build and Deploy NextJS SculptedArc Website on: [push] jobs: - build-and-deploy: - runs-on: ubuntu-latest defaults: @@ -12,41 +10,10 @@ jobs: shell: sh steps: - - name: Check out repository code - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v4 - # 1. Log into your self-hosted gitea container storage layer - name: Log in to gitea Container Registry uses: docker/login-action@v4 with: registry: gitea.sculpted-arc.co.uk # Change to your gitea domain username: ${{ gitea.actor }} - password: ${{ secrets.TOKEN_GITEA }} # Store a personal access token in your repo secrets for security - - # 2. Build the Dockerfile and upload the compiled app image - - name: Build and Push Docker Image - uses: docker/build-push-action@v5 - with: - context: . - push: true - tags: gitea.sculpted-arc.co.uk/${{ gitea.repository }}:latest - - # 3. Securely SSH to the host using masked secrets - - name: Deploy to Server via SSH - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ secrets.SERVER_HOST }} - username: root - key: ${{ secrets.SSH_PRIVATE_KEY }} # Completely invisible to anyone viewing code - script: | - cd /home/james/docker/sculpted-arc-site - - # Authenticate the host machine to pull from gitea's registry - docker login -u ${{ gitea.actor }} -p ${{ secrets.TOKEN_GITEA }} gitea.sculpted-arc.co.uk - - # Pull down the fresh image we just built and restart gracefully - docker compose pull - docker compose up -d --remove-orphans \ No newline at end of file + password: ${{ secrets.TOKEN_GITEA }} # Store a personal access token in your repo secrets for security \ No newline at end of file diff --git a/deploy.yml.bak b/deploy.yml.bak new file mode 100644 index 0000000..70c0b83 --- /dev/null +++ b/deploy.yml.bak @@ -0,0 +1,52 @@ +name: Build and Deploy NextJS SculptedArc Website +on: [push] + +jobs: + + build-and-deploy: + + runs-on: ubuntu-latest + + defaults: + run: + shell: sh + + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + # 1. Log into your self-hosted gitea container storage layer + - name: Log in to gitea Container Registry + uses: docker/login-action@v4 + with: + registry: gitea.sculpted-arc.co.uk # Change to your gitea domain + username: ${{ gitea.actor }} + password: ${{ secrets.TOKEN_GITEA }} # Store a personal access token in your repo secrets for security + + # 2. Build the Dockerfile and upload the compiled app image + - name: Build and Push Docker Image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: gitea.sculpted-arc.co.uk/${{ gitea.repository }}:latest + + # 3. Securely SSH to the host using masked secrets + - name: Deploy to Server via SSH + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.SERVER_HOST }} + username: root + key: ${{ secrets.SSH_PRIVATE_KEY }} # Completely invisible to anyone viewing code + script: | + cd /home/james/docker/sculpted-arc-site + + # Authenticate the host machine to pull from gitea's registry + docker login -u ${{ gitea.actor }} -p ${{ secrets.TOKEN_GITEA }} gitea.sculpted-arc.co.uk + + # Pull down the fresh image we just built and restart gracefully + docker compose pull + docker compose up -d --remove-orphans \ No newline at end of file