Skip to content

Commit d8cfb4e

Browse files
committed
[ci] run both workflows sequentially
1 parent ec767a5 commit d8cfb4e

File tree

2 files changed

+30
-42
lines changed

2 files changed

+30
-42
lines changed

.github/workflows/deploy.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Create and publish a Docker image"]
6+
branches: [main]
7+
types:
8+
- completed
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
14+
steps:
15+
- name: Setup SSH key
16+
shell: bash
17+
env:
18+
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
19+
run: |
20+
mkdir -p ~/.ssh
21+
echo "${SSH_PRIVATE_KEY}" | base64 -d > ${HOME}/.ssh/deploy.id_rsa
22+
chmod 700 ${HOME}/.ssh/deploy.id_rsa
23+
- name: Update Docker container
24+
shell: bash
25+
run: |
26+
ssh -i ${HOME}/.ssh/deploy.id_rsa -o StrictHostKeyChecking=no [email protected] << EOF
27+
docker pull ghcr.io/munichmakerlab/website:main
28+
systemctl restart docker-website.service
29+
systemctl status docker-website.service
30+
EOF

.github/workflows/jekyll-deploy.yml

-42
This file was deleted.

0 commit comments

Comments
 (0)