first fill deploy test with new runner container
Some checks failed
Build and Deploy NextJS SculptedArc Website / build-and-deploy (push) Failing after 1m50s
Some checks failed
Build and Deploy NextJS SculptedArc Website / build-and-deploy (push) Failing after 1m50s
This commit is contained in:
@@ -1,8 +1,11 @@
|
|||||||
|
|
||||||
name: Build and Deploy NextJS SculptedArc Website
|
name: Build and Deploy NextJS SculptedArc Website
|
||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
@@ -10,10 +13,41 @@ jobs:
|
|||||||
shell: sh
|
shell: sh
|
||||||
|
|
||||||
steps:
|
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
|
# 1. Log into your self-hosted gitea container storage layer
|
||||||
- name: Log in to gitea Container Registry
|
- name: Log in to gitea Container Registry
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
registry: gitea.sculpted-arc.co.uk # Change to your gitea domain
|
registry: gitea.sculpted-arc.co.uk # Change to your gitea domain
|
||||||
username: ${{ gitea.actor }}
|
username: ${{ gitea.actor }}
|
||||||
password: ${{ secrets.TOKEN_GITEA }} # Store a personal access token in your repo secrets for security
|
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
|
||||||
@@ -2,9 +2,7 @@ name: Build and Deploy NextJS SculptedArc Website
|
|||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
@@ -12,12 +10,6 @@ jobs:
|
|||||||
shell: sh
|
shell: sh
|
||||||
|
|
||||||
steps:
|
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
|
# 1. Log into your self-hosted gitea container storage layer
|
||||||
- name: Log in to gitea Container Registry
|
- name: Log in to gitea Container Registry
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v4
|
||||||
@@ -25,28 +17,3 @@ jobs:
|
|||||||
registry: gitea.sculpted-arc.co.uk # Change to your gitea domain
|
registry: gitea.sculpted-arc.co.uk # Change to your gitea domain
|
||||||
username: ${{ gitea.actor }}
|
username: ${{ gitea.actor }}
|
||||||
password: ${{ secrets.TOKEN_GITEA }} # Store a personal access token in your repo secrets for security
|
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
|
|
||||||
Reference in New Issue
Block a user