Compare commits
No commits in common. "main" and "main" have entirely different histories.
37
.gitea/workflows/deploy.yml
Normal file
37
.gitea/workflows/deploy.yml
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
name: Deploy website to Docker Container
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
env:
|
||||||
|
CONTAINER_NAME: 11ty-workflow-example
|
||||||
|
CONTAINER_IMAGE: thethomaas/11ty-workflow-example:latest
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install dependencies and build
|
||||||
|
run: |
|
||||||
|
npm ci
|
||||||
|
npm run production
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
run: docker build -t $CONTAINER_IMAGE --build-arg SITE_DIRECTORY=dist .
|
||||||
|
|
||||||
|
- name: Remove old Docker container
|
||||||
|
run: |
|
||||||
|
docker stop $CONTAINER_NAME || true && docker rm $CONTAINER_NAME || true
|
||||||
|
|
||||||
|
- name: Run Docker container
|
||||||
|
run: |
|
||||||
|
docker run -d -p 8086:3000 --name $CONTAINER_NAME --restart=unless-stopped $CONTAINER_IMAGE
|
||||||
|
|
||||||
|
- name: Send webhook to Home-Assistant
|
||||||
|
uses: https://github.com/distributhor/workflow-webhook@v3
|
||||||
|
with:
|
||||||
|
webhook_url: ${{ secrets.HOME_ASSISTANT_WEBHOOK }}
|
||||||
|
|
@ -3,4 +3,4 @@ title: 'Hello world'
|
||||||
layout: 'layouts/home.html'
|
layout: 'layouts/home.html'
|
||||||
---
|
---
|
||||||
|
|
||||||
This is pretty _nice_, right?
|
This is pretty _cool_, right?
|
||||||
Loading…
Reference in a new issue