From f2769fa2f482ab7cb1d64248c5114d3e9fd7949f Mon Sep 17 00:00:00 2001 From: hangpersonal Date: Sat, 18 Oct 2025 22:31:44 -0700 Subject: [PATCH] Add .gitea/workflows/*.yaml --- .gitea/workflows/ci.yml | 4 ++-- .gitea/workflows/docker-build.yml | 19 +++++++++++++------ .gitea/workflows/release.yml | 4 ++-- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d796d38..b7f9bae 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -10,10 +10,10 @@ on: jobs: build-and-test: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml index 9f0303f..d68468a 100644 --- a/.gitea/workflows/docker-build.yml +++ b/.gitea/workflows/docker-build.yml @@ -10,19 +10,26 @@ on: jobs: docker: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Log in to Gitea Registry - run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login gitea.cuihang1201.synology.me -u hangpersonal --password-stdin + run: | + echo "${{ secrets.REGISTRY_TOKEN }}" | \ + docker login gitea.cuihang1201.synology.me -u ${{ secrets.REGISTRY_USER }} --password-stdin - name: Build Docker image - run: docker build -t gitea.cuihang1201.synology.me/hangpersonal/myapp:latest . + run: docker build -t gitea.cuihang1201.synology.me/hangpersonal/docker_build:latest . - name: Run Docker image - run: docker run --rm gitea.cuihang1201.synology.me/hangpersonal/myapp:latest + run: docker run --rm gitea.cuihang1201.synology.me/hangpersonal/docker_build:latest - name: Push Docker image - run: docker push gitea.cuihang1201.synology.me/hangpersonal/myapp:latest + run: docker push gitea.cuihang1201.synology.me/hangpersonal/docker_build:latest + + - name: Clean Docker image on Host + run: | + docker rmi gitea.cuihang1201.synology.me/hangpersonal/docker_build:latest + docker image ls -a \ No newline at end of file diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 1fc2647..3e73a5a 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -13,11 +13,11 @@ jobs: release: # According to the Gitea documentation, the ubuntu-latest label is mapped # internally to Ubuntu 22.04 environments - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout code # Pulls your repo into the runner so it has access to the source code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build artifact # Makes a directory dist/