Skip to content

Commit

Permalink
Merge pull request #1 from artellectual/insterra/packs/12/1706527277
Browse files Browse the repository at this point in the history
Deployment configuration base-astro-static for artellectual.com
  • Loading branch information
zacksiri authored Jan 29, 2024
2 parents 5fd92c6 + f80715b commit 4cd6055
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 2 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: 'Deployment'

on:
push:
branches:
- main
- master
- develop

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0

- name: Setup Pakman
uses: upmaru/pakman@v8
with:
alpine: v3.19

- name: Bootstrap Configuration
run: |
pakman bootstrap
shell: alpine.sh {0}
env:
ABUILD_PRIVATE_KEY: ${{secrets.ABUILD_PRIVATE_KEY}}
ABUILD_PUBLIC_KEY: ${{secrets.ABUILD_PUBLIC_KEY}}

- name: 'Build Package'
run: |
cd "$GITHUB_WORKSPACE"/.apk/"$GITHUB_REPOSITORY" || exit
abuild snapshot
abuild -r
shell: alpine.sh {0}

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ runner.arch }}
path: /home/runner/packages

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/download-artifact@v3
with:
path: /home/runner/artifacts

- name: Setup Pakman
uses: upmaru/pakman@v8
with:
alpine: v3.19

- name: Merge Artifact
run: |
cp -R /home/runner/artifacts/X64/. /home/runner/packages/
sudo zip -r /home/runner/packages.zip "$HOME"/packages
shell: alpine.sh {0}

- name: Push
run: pakman push
shell: alpine.sh {0}
env:
WORKFLOW_REF: ${{ github.ref }}
WORKFLOW_SHA: ${{ github.sha }}
INSTELLAR_ENDPOINT: https://opsmaru.com
INSTELLAR_PACKAGE_TOKEN: ${{secrets.INSTELLAR_PACKAGE_TOKEN}}
INSTELLAR_AUTH_TOKEN: ${{secrets.INSTELLAR_AUTH_TOKEN}}
9 changes: 9 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
auto_https off
admin off
}

:3000 {
root * /var/lib/artellectual-com/dist
file_server
}
51 changes: 51 additions & 0 deletions instellar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
dependencies:
build:
- nodejs-current
- npm
runtime:
- caddy
- bash
- curl
- s6
- jq
- ca-certificates
- artellectual-com-openrc

stack: alpine/3.19

build:
command: |
npm install
npm run build
destinations:
- dist
- Caddyfile

run:
name: artellectual-com
services:
- binary: caddy
name: web
path: /usr/sbin
start:
call: run --config /var/lib/artellectual-com/Caddyfile

hook:
post-deinstall: |
rc-service artellectual-com stop
rc-update del artellectual-com
post-install: |
rc-update add artellectual-com
post-upgrade: |
rc-service artellectual-com start
pre-upgrade: |
rc-service artellectual-com stop
kits:
- description: static site server
main: true
name: web
ports:
- main: true
name: web
target: 3000
4 changes: 2 additions & 2 deletions src/pages/method.astro
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ import Main from '../layouts/main.astro'
</div>
<form action="#" class="mt-12 sm:mx-auto sm:flex sm:max-w-lg">
<div class="min-w-0 flex-1">
<label for="cta-email" class="sr-only">Email address</label>
<input id="cta-email" type="email" class="block w-full rounded-md border border-transparent px-5 py-3 text-base text-gray-900 placeholder-gray-500 shadow-sm focus:border-transparent focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-indigo-600" placeholder="Enter your email">
<label for="cta-email" class="sr-only"><span>Email address</span></label>
<input id="cta-email" type="email" class="block w-full rounded-md border border-transparent px-5 py-3 text-base text-gray-900 placeholder-gray-500 shadow-sm focus:border-transparent focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-indigo-600" placeholder="Enter your email" />
</div>
<div class="mt-4 sm:mt-0 sm:ml-3">
<button type="submit" class="block w-full rounded-md border border-transparent bg-purple-500 px-5 py-3 text-base font-medium text-white shadow hover:bg-purple-400 focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-indigo-600 sm:px-10">Notify me</button>
Expand Down

0 comments on commit 4cd6055

Please sign in to comment.