50 lines
1.5 KiB
YAML
50 lines
1.5 KiB
YAML
name: Deploy to Docker Container
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest:docker
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install dependencies and build
|
|
run: |
|
|
npm ci
|
|
npm run production
|
|
|
|
# - name: Log in to Docker registry
|
|
# uses: docker/login-action@v2
|
|
# with:
|
|
# registry: gitea.local.thethomaas.net
|
|
# username: ${{ secrets.DOCKER_USERNAME }}
|
|
# password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build Docker image
|
|
run: docker build -t thethomaas/11ty-workflow-example:latest --build-arg SITE_DIRECTORY=dist .
|
|
# run: docker build -t gitea.local.thethomaas.net/thethomaas/11ty-workflow-example:latest --build-arg SITE_DIRECTORY=dist .
|
|
|
|
# - name: Push Docker image
|
|
# run: docker push gitea.local.thethomaas.net/thethomaas/11ty-workflow-example:latest
|
|
|
|
# - name: Set up Docker Compose
|
|
# uses: https://github.com/isbang/compose-action@v1.4.1
|
|
# with:
|
|
# compose-file: docker-compose.yml
|
|
|
|
- name: Run Docker container
|
|
run: |
|
|
docker stop dev
|
|
docker rm dev
|
|
docker run -d -p 8086:80 --name dev thethomaas/11ty-workflow-example:latest
|
|
|
|
# run: sudo docker run -d -p 8086:80 -v /mnt/appdata/dev/dist:/usr/share/nginx/html:ro thethomaas/11ty-workflow-example:latest
|
|
|
|
# - name: Start Docker Compose services
|
|
# run: docker-compose up -d
|