Some checks failed
Build & Deploy KLZ Cables / deploy (push) Has been cancelled
43 lines
1.3 KiB
YAML
43 lines
1.3 KiB
YAML
name: Build & Deploy KLZ Cables
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: self-hosted
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Login registry
|
|
run: |
|
|
echo "${{ secrets.REGISTRY_PASS }}" | \
|
|
docker login registry.infra.mintel.me -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
|
|
|
- name: Build image
|
|
run: |
|
|
docker build \
|
|
--pull \
|
|
--build-arg NEXT_PUBLIC_UMAMI_WEBSITE_ID=${{ secrets.NEXT_PUBLIC_UMAMI_WEBSITE_ID }} \
|
|
--build-arg NEXT_PUBLIC_UMAMI_SCRIPT_URL=${{ secrets.NEXT_PUBLIC_UMAMI_SCRIPT_URL }} \
|
|
--build-arg NEXT_PUBLIC_SENTRY_DSN=${{ secrets.SENTRY_DSN }} \
|
|
-t registry.infra.mintel.me/mintel/klz-cables.com:latest .
|
|
|
|
- name: Push image
|
|
run: |
|
|
docker push registry.infra.mintel.me/mintel/klz-cables.com:latest
|
|
|
|
- name: Deploy
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
printf "%s\n" "${{ secrets.ALPHA_SSH_KEY }}" > ~/.ssh/id_ed25519
|
|
chmod 600 ~/.ssh/id_ed25519
|
|
ssh-keyscan -H alpha.mintel.me >> ~/.ssh/known_hosts
|
|
|
|
ssh deploy@alpha.mintel.me '
|
|
docker pull registry.infra.mintel.me/mintel/klz-cables.com:latest
|
|
cd /home/deploy/sites/klz-cables.com
|
|
docker compose up -d --force-recreate
|
|
' |