add readme and more

试着加个这玩意

Fix | 应该是 r+

auto update with Gitea Actions

尝试一些新东西(

我的问题(

auto update with Gitea Actions

2?

待会得 squash了

auto update with Gitea Actions

好好好

now?

auto update with Gitea Actions

是这样?

reeee

好好好

再试一次

得了,新建一个分支吧

try try

忘记 push -f 了(
This commit is contained in:
shenjack 2023-12-08 23:15:52 +08:00
parent cd64b711cb
commit 0e64c9e56c
Signed by: shenjack
GPG Key ID: 7B1134A979775551
4 changed files with 51 additions and 14 deletions

View File

@ -5,24 +5,42 @@ on: [push]
jobs: jobs:
Explore-Gitea-Actions: Explore-Gitea-Actions:
runs-on: node-21 runs-on: node-21
# 目前稳定能使用的 runner 就是 node 21 了
steps: steps:
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." - name: 各种事件展示
run: |
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" echo "任务是由 ${{ gitea.event_name }} 事件触发的"
echo "你的分支是 ${{ gitea.ref }}"
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." echo "你的仓库是 ${{ gitea.repository }}"
- name: Check out repository code - name: Check out repository code
uses: http://shenjack.top:5100/mirror/checkout@v4 uses: http://shenjack.top:5100/mirror/checkout@v4
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." - name: 展示其他信息
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: | run: |
ls ${{ gitea.workspace }} echo "你的分支是 ${{ gitea.ref }}"
echo "你的仓库是 ${{ gitea.repository }}"
echo "你的仓库地址是 ${{ gitea.repository_url }}"
echo "你的仓库路径是 ${{ gitea.workspace }}"
echo "你的仓库地址是 ${{ gitea.workspace_url }}"
echo "这个 Action 的运行状态是 ${{ job.status }}"
echo ls ${{ gitea.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}." - name: 展示 python 版本
run: |
- run: python3 test.py python3 test.py
python3 -c "import sys;print(sys.version)"
python3 run.py
- name: 推送修改
run: |
git config user.name gitea-actions
git config user.email gitea-action@shenjack.top
git add .
git commit -m "auto update with Gitea Actions"
# 创建并切换到deploy分支
git checkout -b deploy
# 将更改添加到deploy分支的最新提交
git commit --amend --no-edit
# 推送到deploy分支
git push origin HEAD --force

7
readme.md Normal file
View File

@ -0,0 +1,7 @@
# Gitea Action Demo 展示
欢迎来到这里!
这里是一个 Gitea action 的展示仓库, 你可以在这里看到 Gitea action 的效果.
同时你也可以参考这里编写的 mirros 来在编写你自己的 action 的时候使用本地镜像来加速使用

12
run.py Normal file
View File

@ -0,0 +1,12 @@
import time
with open('test.md', 'r+', encoding='utf-8') as md_file:
md = md_file.read()
print(md)
md_file.write('hello action!')
md_file.write(f'greeting from {time.time()}\n')
date_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
md_file.write(date_time)
md_file.write('\n')

0
test.md Normal file
View File