2024-08-12 16:54:18 +08:00
|
|
|
name: Gitea Actions Demo
|
2024-08-12 16:59:43 +08:00
|
|
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
2024-08-12 16:54:18 +08:00
|
|
|
on: [push]
|
2024-08-12 16:59:43 +08:00
|
|
|
|
2024-08-12 16:54:18 +08:00
|
|
|
jobs:
|
|
|
|
Explore-Gitea-Actions:
|
2024-08-12 16:56:49 +08:00
|
|
|
runs-on: ps_runner_labels
|
2024-08-13 08:29:46 +08:00
|
|
|
container:
|
2024-08-13 08:28:53 +08:00
|
|
|
image: catthehacker/ubuntu:act-latest
|
2024-08-13 08:30:14 +08:00
|
|
|
volumes:
|
|
|
|
- ubuntu_hostedtoolcache:/opt/hostedtoolcache
|
2024-08-12 16:54:18 +08:00
|
|
|
steps:
|
2024-08-12 16:59:43 +08:00
|
|
|
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
|
|
|
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
|
|
|
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
|
|
|
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
|
|
|
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
2024-08-12 17:08:49 +08:00
|
|
|
- run: echo "🍏 This job's status is ${{ job.status }}."
|
2024-08-13 09:56:16 +08:00
|
|
|
- run: docker version
|
2024-08-13 09:48:26 +08:00
|
|
|
- name: Checkout
|
2024-08-13 09:55:30 +08:00
|
|
|
uses: https://gitea.com/actions/checkout@v4
|
2024-08-13 09:48:26 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2024-08-13 10:44:42 +08:00
|
|
|
- run: echo "🛠️ The Gitea Actions workflow is now ready to test your code on the runner."
|
2024-08-13 11:16:26 +08:00
|
|
|
# - name: Install Go
|
|
|
|
# run: |
|
|
|
|
# apt-get update
|
|
|
|
# apt-get install -y golang
|
|
|
|
# - name: Set Go Proxy
|
|
|
|
# run: go env -w GOPROXY=https://goproxy.cn,direct
|
2024-08-13 10:44:42 +08:00
|
|
|
- name: Build Docker image
|
|
|
|
run: docker build -t my-docker-image .
|
2024-08-13 10:52:40 +08:00
|
|
|
- name: Deploy to local Docker
|
2024-08-13 10:51:28 +08:00
|
|
|
run: docker run -d -p 8080:80 my-docker-image
|
2024-08-13 11:09:12 +08:00
|
|
|
|
2024-08-13 10:44:42 +08:00
|
|
|
|