add workflows
This commit is contained in:
13
.gitea/workflows/demo.yml
Normal file
13
.gitea/workflows/demo.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
name: Test
|
||||||
|
run-name: ${{ gitea.actor }} greets Habr!
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
print-content:
|
||||||
|
name: Print content
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: list directory contents
|
||||||
|
run: ls -la
|
||||||
33
.gitea/workflows/docker_build_demo.yml
Normal file
33
.gitea/workflows/docker_build_demo.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Docker Build Demo
|
||||||
|
|
||||||
|
# Optional run-name, visible in the Gitea Actions UI
|
||||||
|
run-name: ${{ github.actor }} is building a Docker image 🚀
|
||||||
|
|
||||||
|
# Trigger the workflow on push events
|
||||||
|
on: push
|
||||||
|
|
||||||
|
# Define jobs to run
|
||||||
|
jobs:
|
||||||
|
Build-Docker-Image:
|
||||||
|
# Specify the runner environment
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# Step 1: Checkout the repository code
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Step 2: Build the Docker image
|
||||||
|
- name: Build Docker image
|
||||||
|
run: |
|
||||||
|
docker build -t my-image:latest .
|
||||||
|
|
||||||
|
# Step 3: Login to a Docker Registry (e.g., Docker Hub or Gitea's registry)
|
||||||
|
- name: Login to Docker Registry
|
||||||
|
# Use Gitea secrets for credentials for security
|
||||||
|
run: echo "${{ secrets.DOCKERPWD }}" | docker login -u "${{ secrets.DOCKERUSER }}" --password-stdin
|
||||||
|
|
||||||
|
# Step 4: Tag and Push the Docker image
|
||||||
|
- name: Push Docker image
|
||||||
|
run: |
|
||||||
|
docker tag my-image:latest "${{ secrets.DOCKERUSER }}/dev:latest"
|
||||||
|
docker push "${{ secrets.DOCKERUSER }}/dev:latest"
|
||||||
Reference in New Issue
Block a user