Skip to content

Commit 6ddd058

Browse files
committed
update
1 parent 53eee76 commit 6ddd058

4 files changed

Lines changed: 53 additions & 0 deletions

File tree

lib/stack-service-base/project_template/home/src/views/layout.slim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ html
1313
font-family: "Courier New", monospace
1414
body
1515
== yield
16+
span.version = "v " + (ENV['ORG_OPENCONTAINERS_IMAGE_VERSION'] || '0.0.0')
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.drs linguist-language=Ruby
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
on: { push: { branches: [master,main,release,dev] } }
2+
3+
jobs:
4+
deploy:
5+
runs-on: ubuntu-latest
6+
timeout-minutes: 20
7+
env:
8+
DEPLOY_SERVER: ${{ secrets.DEPLOY_SERVER }}
9+
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
10+
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
11+
# ssh-keygen -t ed25519 -C "github-actions-deploy" -f ~/.ssh/github_actions_deploy -N ""
12+
# cat ~/.ssh/github_actions_deploy.pub >> ~/.ssh/authorized_keys
13+
# chmod 600 ~/.ssh/authorized_keys
14+
# base64 -w 0 ~/.ssh/github_actions_deploy
15+
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
16+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
17+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- run: |
22+
sudo apt-get update
23+
sudo apt-get install -y --no-install-recommends ruby ruby-dev build-essential
24+
sudo gem install dry-stack:0.1.54
25+
26+
- run: |
27+
test -n "$DEPLOY_SERVER"
28+
test -n "$DEPLOY_KEY"
29+
mkdir -p ~/.ssh
30+
echo "$DEPLOY_KEY" | base64 -d > ~/.ssh/id_rsa
31+
chmod 600 ~/.ssh/id_rsa
32+
printf 'Host *\n\tBatchMode yes\n\tStrictHostKeyChecking no\n' > ~/.ssh/config
33+
chmod 400 ~/.ssh/config
34+
35+
- run: |
36+
if [ -n "$DOCKER_USERNAME" ] && [ -n "$DOCKER_PASSWORD" ]; then
37+
registry="${DOCKER_REGISTRY:-docker.io}"
38+
echo "$DOCKER_PASSWORD" | docker login "$registry" -u "$DOCKER_USERNAME" --password-stdin
39+
else
40+
echo "Skipping Docker registry login; DOCKER_USERNAME or DOCKER_PASSWORD is not set."
41+
fi
42+
43+
- working-directory: stack
44+
run: |
45+
deploy_target="$DEPLOY_SERVER"
46+
if ! printf '%s' "$deploy_target" | grep -q '@'; then
47+
deploy_target="${DEPLOY_USER:-root}@${deploy_target}"
48+
fi
49+
50+
dry-stack swarm_deploy -x "ssh://${deploy_target}" -- --prune --resolve-image=always < ruby-mitm-proxy.drs

lib/stack-service-base/stack_template/home/stack/stack.drs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# vim: set syntax=ruby:
12
Options name: 'stack-name'
23

34
Service :service_name, image: 'service_name/master', ports: 7000, ingress: { host: 'service_name.*' }

0 commit comments

Comments
 (0)