adding steps to authenticate with Dockerhub to pipeline
This commit is contained in:
+32
-17
@@ -1,4 +1,4 @@
|
||||
name: Skyweave Test & Lint Ritual
|
||||
name: Skyweave Test, Lint, and Deploy Ritual
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -9,34 +9,44 @@ on:
|
||||
jobs:
|
||||
test-and-lint:
|
||||
name: Test and Lint Code
|
||||
runs-on: ubuntu-latest # This key was missing from your linting job
|
||||
|
||||
# We use a single, public image that has Node.js for the checkout action
|
||||
container:
|
||||
image: node:lts-alpine
|
||||
runs-on: ubuntu-latest # CORRECTED: This key was missing.
|
||||
|
||||
steps:
|
||||
- name: 1. Checkout Repository Code
|
||||
- name: 1. Authenticate to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: 2. Checkout Repository Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 2. Install Lua Dependencies
|
||||
- name: 3. Install Lua Dependencies in Alpine
|
||||
# We must run this step inside the target container
|
||||
uses: add-and-commit/docker-run-action@v3
|
||||
with:
|
||||
image: node:lts-alpine
|
||||
# The shell command is now run within the node:lts-alpine container
|
||||
run: |
|
||||
echo "Sanctifying container with Lua tools..."
|
||||
# Installs luacheck for linting, and Lua + Luarocks for Busted
|
||||
apk add --no-cache luacheck lua5.1-dev build-base git luarocks
|
||||
luarocks-5.1 install busted
|
||||
cp lib/json.lua skyweave/
|
||||
|
||||
- name: 3. Run Luacheck Scrutiny
|
||||
- name: 4. Run Luacheck Scrutiny in Alpine
|
||||
uses: add-and-commit/docker-run-action@v3
|
||||
with:
|
||||
image: node:lts-alpine
|
||||
run: |
|
||||
echo "Scanning Lua scripture..."
|
||||
# With your perfected .luacheckrc, this single command handles all files
|
||||
luacheck --std lua51 .
|
||||
|
||||
- name: 4. Perform Unit Inquisition (Busted)
|
||||
- name: 5. Perform Unit Inquisition (Busted) in Alpine
|
||||
uses: add-and-commit/docker-run-action@v3
|
||||
with:
|
||||
image: node:lts-alpine
|
||||
run: |
|
||||
echo "Initiating unit tests..."
|
||||
# Busted will automatically find and run files in the 'spec/' directory
|
||||
busted --lua=lua5.1 --verbose spec/
|
||||
|
||||
deploy-to-device:
|
||||
@@ -46,10 +56,16 @@ jobs:
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||
|
||||
steps:
|
||||
- name: 1. Checkout Repository Code
|
||||
- name: 1. Authenticate to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: 2. Checkout Repository Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 2. Prepare SSH Environment
|
||||
- name: 3. Prepare SSH Environment
|
||||
run: |
|
||||
echo "Preparing the sacred keys and crypto-litany for SSH communion..."
|
||||
mkdir -p ~/.ssh/
|
||||
@@ -58,7 +74,6 @@ jobs:
|
||||
|
||||
ssh-keyscan -H "${{ secrets.ROOF_UNIT_HOSTNAME }}" >> ~/.ssh/known_hosts
|
||||
|
||||
# Recreate the SSH alias, now including the required legacy crypto options
|
||||
echo "Host roof-unit" > ~/.ssh/config
|
||||
echo " HostName ${{ secrets.ROOF_UNIT_HOSTNAME }}" >> ~/.ssh/config
|
||||
echo " User ${{ secrets.ROOF_UNIT_USER }}" >> ~/.ssh/config
|
||||
@@ -68,7 +83,7 @@ jobs:
|
||||
echo " MACs +hmac-sha1" >> ~/.ssh/config
|
||||
echo " PubkeyAcceptedAlgorithms +ssh-rsa" >> ~/.ssh/config
|
||||
|
||||
- name: 3. Execute Deployment Ritual
|
||||
- name: 4. Execute Deployment Ritual
|
||||
run: |
|
||||
echo "Initiating deployment sequence..."
|
||||
chmod +x ./skyweave_deploy.sh
|
||||
|
||||
Reference in New Issue
Block a user