move to gitea
Some checks failed
App Image CI / Build app image (push) Failing after -18s

This commit is contained in:
Cory Sanin 2025-04-29 20:56:09 -05:00
parent 9722c4f992
commit 1fea301ecf
7 changed files with 53 additions and 82 deletions

View File

@ -17,8 +17,6 @@ jobs:
runs-on: ubuntu-latest
env:
DH_REGISTRY: docker.io
GH_REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
REPOSITORY: ${{ github.event.repository.name }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
permissions:
@ -42,60 +40,24 @@ jobs:
registry: ${{ env.DH_REGISTRY }}
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.GH_REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for release Docker image
if: startsWith(github.ref, 'refs/tags/v')
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKER_USERNAME }}/${{ env.REPOSITORY }}
${{ env.GH_REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Extract metadata for develop Docker image
if: "!startsWith(github.ref, 'refs/tags/v')"
id: meta-develop
uses: docker/metadata-action@v5
with:
images: |
${{ env.GH_REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
- name: Build and push release Docker image
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/build-push-action@v6
with:
target: deploy
push: true
push: startsWith(github.ref, 'refs/tags/v')
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
cache-from: type=gha,scope=${{ github.workflow }}
cache-to: type=gha,mode=max,scope=${{ github.workflow }}
- name: Build and push develop Docker image
if: "!startsWith(github.ref, 'refs/tags/v')"
uses: docker/build-push-action@v6
with:
target: deploy
push: true
tags: ${{ steps.meta-develop.outputs.tags }}
labels: ${{ steps.meta-develop.outputs.labels }}
platforms: linux/amd64
cache-from: type=gha,scope=${{ github.workflow }}
cache-to: type=gha,mode=max,scope=${{ github.workflow }}

View File

@ -39,22 +39,22 @@ jobs:
run: echo "DEPLOY=true" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v4
uses: https://github.com/actions/checkout@v4
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
uses: https://github.com/docker/setup-buildx-action@v3
with:
install: true
- name: Log in to the Docker Hub
uses: docker/login-action@v3
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker image
uses: docker/build-push-action@v6
uses: https://github.com/docker/build-push-action@v6
with:
push: ${{ env.DEPLOY }}
pull: true

52
package-lock.json generated
View File

@ -1,21 +1,21 @@
{
"name": "archery",
"version": "0.1.5",
"version": "0.1.6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "archery",
"version": "0.1.5",
"version": "0.1.6",
"license": "MIT",
"dependencies": {
"body-parser": "^1.20.3",
"ejs": "3.1.10",
"express": "^4.21.2",
"express-ws": "^5.0.2",
"pg": "^8.13.1",
"pg": "^8.15.6",
"pg-hstore": "^2.3.4",
"sequelize": "^6.37.5"
"sequelize": "^6.37.7"
},
"devDependencies": {
"@types/csso": "5.0.4",
@ -1459,14 +1459,14 @@
"license": "MIT"
},
"node_modules/pg": {
"version": "8.13.1",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.13.1.tgz",
"integrity": "sha512-OUir1A0rPNZlX//c7ksiu7crsGZTKSOXJPgtNiHGIlC9H0lO+NC6ZDYksSgBYY/thSWhnSRBv8w1lieNNGATNQ==",
"version": "8.15.6",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.15.6.tgz",
"integrity": "sha512-yvao7YI3GdmmrslNVsZgx9PfntfWrnXwtR+K/DjI0I/sTKif4Z623um+sjVZ1hk5670B+ODjvHDAckKdjmPTsg==",
"license": "MIT",
"dependencies": {
"pg-connection-string": "^2.7.0",
"pg-pool": "^3.7.0",
"pg-protocol": "^1.7.0",
"pg-connection-string": "^2.8.5",
"pg-pool": "^3.9.6",
"pg-protocol": "^1.9.5",
"pg-types": "^2.1.0",
"pgpass": "1.x"
},
@ -1474,7 +1474,7 @@
"node": ">= 8.0.0"
},
"optionalDependencies": {
"pg-cloudflare": "^1.1.1"
"pg-cloudflare": "^1.2.5"
},
"peerDependencies": {
"pg-native": ">=3.0.1"
@ -1486,16 +1486,16 @@
}
},
"node_modules/pg-cloudflare": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz",
"integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==",
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.2.5.tgz",
"integrity": "sha512-OOX22Vt0vOSRrdoUPKJ8Wi2OpE/o/h9T8X1s4qSkCedbNah9ei2W2765be8iMVxQUsvgT7zIAT2eIa9fs5+vtg==",
"license": "MIT",
"optional": true
},
"node_modules/pg-connection-string": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.7.0.tgz",
"integrity": "sha512-PI2W9mv53rXJQEOb8xNR8lH7Hr+EKa6oJa38zsK0S/ky2er16ios1wLKhZyxzD7jUReiWokc9WK5nxSnC7W1TA==",
"version": "2.8.5",
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.8.5.tgz",
"integrity": "sha512-Ni8FuZ8yAF+sWZzojvtLE2b03cqjO5jNULcHFfM9ZZ0/JXrgom5pBREbtnAw7oxsxJqHw9Nz/XWORUEL3/IFow==",
"license": "MIT"
},
"node_modules/pg-hstore": {
@ -1520,18 +1520,18 @@
}
},
"node_modules/pg-pool": {
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.7.0.tgz",
"integrity": "sha512-ZOBQForurqh4zZWjrgSwwAtzJ7QiRX0ovFkZr2klsen3Nm0aoh33Ls0fzfv3imeH/nw/O27cjdz5kzYJfeGp/g==",
"version": "3.9.6",
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.9.6.tgz",
"integrity": "sha512-rFen0G7adh1YmgvrmE5IPIqbb+IgEzENUm+tzm6MLLDSlPRoZVhzU1WdML9PV2W5GOdRA9qBKURlbt1OsXOsPw==",
"license": "MIT",
"peerDependencies": {
"pg": ">=8.0"
}
},
"node_modules/pg-protocol": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.7.0.tgz",
"integrity": "sha512-hTK/mE36i8fDDhgDFjy6xNOG+LCorxLG3WO17tku+ij6sVHXh1jQUJ8hYAnRhNla4QVD2H8er/FOjc/+EgC6yQ==",
"version": "1.9.5",
"resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.9.5.tgz",
"integrity": "sha512-DYTWtWpfd5FOro3UnAfwvhD8jh59r2ig8bPtc9H8Ds7MscE/9NYruUQWFAOuraRl29jwcT2kyMFQ3MxeaVjUhg==",
"license": "MIT"
},
"node_modules/pg-types": {
@ -1783,9 +1783,9 @@
"license": "MIT"
},
"node_modules/sequelize": {
"version": "6.37.5",
"resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.37.5.tgz",
"integrity": "sha512-10WA4poUb3XWnUROThqL2Apq9C2NhyV1xHPMZuybNMCucDsbbFuKg51jhmyvvAUyUqCiimwTZamc3AHhMoBr2Q==",
"version": "6.37.7",
"resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.37.7.tgz",
"integrity": "sha512-mCnh83zuz7kQxxJirtFD7q6Huy6liPanI67BSlbzSYgVNl5eXVdE2CN1FuAeZwG1SNpGsNRCV+bJAVVnykZAFA==",
"funding": [
{
"type": "opencollective",

View File

@ -1,6 +1,6 @@
{
"name": "archery",
"version": "0.1.5",
"version": "0.1.6",
"description": "Build Arch packages through a web interface",
"keywords": [
"docker",
@ -24,9 +24,9 @@
"ejs": "3.1.10",
"express": "^4.21.2",
"express-ws": "^5.0.2",
"pg": "^8.13.1",
"pg": "^8.15.6",
"pg-hstore": "^2.3.4",
"sequelize": "^6.37.5"
"sequelize": "^6.37.7"
},
"devDependencies": {
"@types/csso": "5.0.4",

View File

@ -13,12 +13,14 @@ document.addEventListener('DOMContentLoaded', function () {
/**
* Add log line to the DOM
* @param {string} str
* @param {string[]} str
*/
function appendLine(str, e = false) {
const p = document.createElement('p');
p.appendChild(document.createTextNode(str));
logContainer.appendChild(p);
function appendLines(str, e = false) {
str.forEach(line => {
const p = document.createElement('p');
p.appendChild(document.createTextNode(line));
logContainer.appendChild(p);
});
}
/**
@ -30,6 +32,14 @@ document.addEventListener('DOMContentLoaded', function () {
}
}
/**
* Split string by newline char
* @param {string} str
*/
function splitLines(str) {
return str.split('\n').map(line => line.substring(line.lastIndexOf('\r') + 1));
}
/**
* Establish websocket connection
*/
@ -41,15 +51,14 @@ document.addEventListener('DOMContentLoaded', function () {
var ws = new WebSocket(new_uri);
ws.onmessage = function (message) {
console.log('Got message: ', message);
const buildEvent = JSON.parse(message.data);
if (buildEvent.type === 'finish') {
ws.close();
buildStatusTxt.replaceChild(document.createTextNode(buildEvent.message), buildStatusTxt.firstChild);
}
else {
appendLine(buildEvent.message, buildEvent.type === 'err');
appendLines(splitLines(buildEvent.message), buildEvent.type === 'err');
scrollToBottom();
}
}

View File

@ -37,7 +37,7 @@
<%- include("footer", locals) %>
<script src="/assets/js/timezone.js?v1" nonce="<%= cspNonce %>"></script>
<% if (!ended) { %>
<script src="/assets/js/build.js?v1" nonce="<%= cspNonce %>"></script>
<script src="/assets/js/build.js?v2" nonce="<%= cspNonce %>"></script>
<% } %>
</body>
</html>

View File

@ -3,7 +3,7 @@
<ul>
<li><a href="/">Home</a></li>
<li>Developed by Cory Sanin</li>
<li><a href="https://github.com/CorySanin/archery">Source</a></li>
<li><a href="https://git.sanin.dev/corysanin/archery">Source</a></li>
</ul>
</footer>
</div>