dockerize and CI attempt 1
This commit is contained in:
parent
f9f29d6be7
commit
190570fa52
|
@ -0,0 +1,2 @@
|
|||
node_modules
|
||||
dist
|
|
@ -0,0 +1,56 @@
|
|||
name: Deploy
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
Deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Start webhook
|
||||
if: ${{always()}}
|
||||
continue-on-error: true
|
||||
uses: fjogeleit/http-request-action@v1
|
||||
with:
|
||||
url: ${{vars.NODE_RED_WORKFLOW_STARTED_URL}}
|
||||
data: '{"job": ${{toJSON(job)}}, "gitea": ${{toJSON(gitea)}}}'
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Docker install
|
||||
run: |
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update
|
||||
apt-get install -yqq ca-certificates curl
|
||||
install -m 0755 -d /etc/apt/keyrings
|
||||
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
|
||||
chmod a+r /etc/apt/keyrings/docker.asc
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
|
||||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
||||
tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
apt-get update
|
||||
apt-get install -yqq docker-ce docker-ce-cli containerd.io
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Docker Login
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.riksolo.com
|
||||
username: riksolo
|
||||
password: ${{secrets.CONTAINER_REGISTRY_TOKEN}}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: git.riksolo.com/riksolo/eleventy-riksolo-com:latest , eleventy-riksolo-com:${{github.sha}}
|
||||
|
||||
- name: Completion webhook
|
||||
if: ${{always()}}
|
||||
continue-on-error: true
|
||||
uses: fjogeleit/http-request-action@v1
|
||||
with:
|
||||
url: ${{vars.NODE_RED_WORKFLOW_COMPLETE_URL}}
|
||||
data: '{"job": ${{toJSON(job)}}, "gitea": ${{toJSON(gitea)}}}'
|
|
@ -0,0 +1,10 @@
|
|||
FROM node:22
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
ADD . .
|
||||
RUN npm run build
|
||||
|
||||
FROM php:7.4-apache
|
||||
COPY --from=0 /usr/src/app/dist /var/www/html/
|
|
@ -4,7 +4,8 @@
|
|||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"serve": "npx @11ty/eleventy --serve"
|
||||
"serve": "npx @11ty/eleventy --serve",
|
||||
"build": "npx @11ty/eleventy"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
|
@ -17,4 +18,4 @@
|
|||
"luxon": "^3.5.0",
|
||||
"sass": "^1.83.4"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue