Files
my-app/.gitea/workflows/demo.yaml
Patrick 5d2ad902fb
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
checks / Check & Test (Frontend + Backend) (push) Failing after 1s
Gitea Actions Demo / Explore-Gitea-Actions (pull_request) Successful in 4s
checks / Check & Test (Frontend + Backend) (pull_request) Failing after 2s
install node all
2025-10-29 17:02:57 +01:00

73 lines
2.1 KiB
YAML

name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- name: Info
run: |
echo "Triggered by ${{ gitea.event_name }} event"
echo "Branch: ${{ gitea.ref }}"
echo "Repository: ${{ gitea.repository }}"
- name: Install Node.js, npm, and Yarn
run: |
set -e
echo "Detecting OS and installing Node.js, npm, and Yarn..."
if command -v apt >/dev/null 2>&1; then
echo "Using apt package manager (Debian/Ubuntu)..."
apt update -y
apt install -y curl ca-certificates
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt install -y nodejs
npm install -g yarn
elif command -v apk >/dev/null 2>&1; then
echo "Using apk package manager (Alpine)..."
apk update
apk add --no-cache curl nodejs npm
npm install -g yarn
elif command -v dnf >/dev/null 2>&1; then
echo "Using dnf package manager (Fedora/RHEL)..."
dnf install -y curl ca-certificates nodejs npm
npm install -g yarn
else
echo "No supported package manager found (apt, apk, dnf)."
exit 1
fi
echo "Node.js, npm, and Yarn installed successfully."
node -v
npm -v
yarn -v
- name: Checkout repository manually
env:
TOKEN: ${{ secrets.ACCESS_TOKEN }}
CLONE_URL: ${{ vars.CLONE_URL }}
run: |
echo "Cloning from $CLONE_URL"
echo "Cloning ALL_REPO_TOKEN $ALL_REPO_TOKEN"
CLONE_URL_WITH_AUTH=$(echo "$CLONE_URL" | sed "s#https://#https://$ALL_REPO_TOKEN@#")
git clone "$CLONE_URL_WITH_AUTH" .
- name: List repo files and dependencies versions
run: |
ls .
- name: Done
run: echo "Workflow finished."