Master commit next.
This commit is contained in:
40
.gitea/workflows/default.yml
Normal file
40
.gitea/workflows/default.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Gitea CI/CD
|
||||
|
||||
on:
|
||||
push: [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/your-image-name:${{ github.sha }} .
|
||||
|
||||
- name: Push Docker image to registry
|
||||
run: docker push registry.rokoh.com/your-image-name:${{ 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/your-image-name:${{ github.sha }}
|
||||
|
||||
- name: Run Docker container
|
||||
run: docker run -d -p 80:80 registry.rokoh.com/your-image-name:${{ github.sha }}
|
||||
Reference in New Issue
Block a user