Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Make energy alerts stateful (#55) #65

Make energy alerts stateful (#55)

Make energy alerts stateful (#55) #65

Workflow file for this run

name: Continuous Integration
on:
pull_request:
branches:
- master
push:
branches:
- master
workflow_dispatch:
jobs:
ci:
name: Continuous Integration
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: yarn
- name: Lint
run: yarn lint
- name: Typecheck
run: yarn tsc
- name: Test
run: yarn test
- name: Build
run: yarn build
cd:
name: Continuous Deployment
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-22.04
needs:
- ci
steps:
- 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
with:
driver-opts: image=moby/buildkit:master
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push app to GitHub Container Registry
uses: docker/build-push-action@v5
with:
file: Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
- name: Set up Docker context
uses: amirmarmul/docker-context-ssh-action@v2
with:
ssh-host: ${{ secrets.SSH_HOST }}
ssh-username: ${{ secrets.SSH_USER }}
ssh-private-key: ${{ secrets.SSH_KEY }}
context-name: cloud
context-use: true
- name: Deploy application
env:
GHCR_USER: ${{ secrets.GHCR_TOKEN }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
COMPOSE_PROJECT_NAME: ${{ github.event.repository.name }}
run: |
docker-compose pull --quiet
docker-compose up --detach app