Skip to content

deploy live only

deploy live only #2

name: CI push Vue App to registry.kolle.dev
on:
push:
branches:
- 'main'
- 'dev'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository 🕹️
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to registry.kolle.dev Hub
uses: docker/login-action@v3
with:
registry: registry.kolle.dev
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: registry.kolle.dev/cowiki-vue
- name: Build 🚜
if: ${{ github.ref == 'refs/heads/dev' }}
uses: docker/build-push-action@v5
with:
context: ./vue
build-args: MODE=staging
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build 🚜
if: ${{ github.ref == 'refs/heads/main' }}
uses: docker/build-push-action@v5
with:
context: ./vue
build-args: MODE=production
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# - name: Deploy DEV 🚀
# if: ${{ github.ref == 'refs/heads/dev' }}
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.SSH_HOST }}
# username: ${{ secrets.SSH_USER }}
# key: ${{ secrets.SSH_KEY }}
# port: ${{ secrets.PORT }}
# script: |
# cd /opt/containers/cotest
# docker-compose pull cotest.vue
# docker-compose up -d --force-recreate cotest.vue
- name: Deploy MAIN 🚀
if: ${{ github.ref == 'refs/heads/main' }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
docker compose pull vue
docker compose up -d --force-recreate vue