Files
Rokoh/.gitea/workflows/default.yml
2024-05-06 22:59:09 +10:00

40 lines
995 B
YAML

name: Gitea CI/CD
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to Docker registry
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: https://registry.rokoh.com
- name: Build Docker image
run: docker build -t registry.rokoh.com/rokoh:${{ github.sha }} -f rokoh/Dockerfile
- name: Push Docker image to registry
run: docker push registry.rokoh.com/rokoh:${{ github.sha }}
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Install Docker
uses: docker/setup-action@v2
- name: Pull Docker image from registry
run: docker pull registry.rokoh.com/rokoh:${{ github.sha }}
- name: Run Docker container
run: docker run -d -p 6000:80 registry.rokoh.com/rokoh:${{ github.sha }}