2 Commits

Author SHA1 Message Date
tom.coursow c6929616ab „README.md“ ändern
Gitea Actions Demo / Build (push) Successful in 34s
Gitea Actions Demo / Deploy (push) Successful in 35s
2023-07-12 19:37:32 +02:00
tom.coursow 236ad9c766 „README.md“ ändern
Gitea Actions Demo / Build (push) Successful in 37s
Gitea Actions Demo / Deploy (push) Successful in 41s
Output Information / info (pull_request) Successful in 10s
2023-07-12 19:29:32 +02:00
8 changed files with 30 additions and 220 deletions
+16 -95
View File
@@ -1,120 +1,41 @@
# .gitea/workflows/build.yaml # .gitea/workflows/build.yaml
name: Build Workflow name: Gitea Actions Demo
on: run-name: ${{ github.actor }} is testing out Gitea Actions 🚀
workflow_dispatch: on: [workflow_dispatch, push]
push:
branches:
- main
#paths-ignore:
# - '.gitea/workflows/*'
jobs: jobs:
Build: Build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs:
# js-file: name of the output (choosen here)
# steps-js-filename -> The ID of the step which will produce a output (see Publish JS Filename Step)
# script-file -> The key name which contains the output (saved by the step - see Publish JS Filename Step)
js-file: ${{ steps.publish-js-filename.outputs.script-file }}
steps: steps:
# Reusing other Workflows does not work on Gitea yet (17.07.2023) So GitHub only for now.
#- name: Use Other (reuse.yml) Workflow
# uses: ./.gitea/workflows/reuse.yml
# with:
# person: ChatGPT
- name: Error on purpose
id: failingstep
continue-on-error: true
run: exit 1
#- name: Continue with this step anyway
# if: ${{ failure() && steps.failingstep.conclusion == 'failure' }}
# run: echo "Still running... ${{toJSON(steps)}}"
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Install NodeJS - name: Install NodeJS
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: '18' node-version: '18'
- uses: actions/setup-go@v3
with:
go-version: '>=1.20.1'
#- uses: seepine/hash-files@v1
- uses: https://gitea.com/actions/go-hashfiles@v0.0.1
id: get-cache-hash
with:
patterns: |-
package-lock.json
- name: Show key future key value
run: echo "deps-node-modules-${{ steps.get-cache-hash.outputs.hash }}"
- name: Setup Chache
id: cache-modules
uses: actions/cache@v3
with:
path: ~/.npm
key: deps-node-modules-${{ steps.get-cache-hash.outputs.hash }}
- name: Check Cache Hit
run: echo "Hit Cache - ${{ steps.cache-modules.outputs.cache-hit }}"
- name: Install Dependencies - name: Install Dependencies
run: npm ci run: npm ci
- name: Run Tests - name: Run Tests
run: npm test run: npm test
- name: Build
run: npm run build
- name: Publish JS Filename
id: publish-js-filename
# Finds the desired Javascript file and prints a string 'script-file=<JS-FILENAME>' which then gets saved in the $GITHUB_OUTPUT file
run: find dist/assets/*.js -type f -execdir echo 'script-file={}' >> $GITHUB_OUTPUT ';'
- name: Package Artifacts
uses: thedoctor0/zip-release@0.7.1
with:
type: 'tar'
path: dist
filename: 'dist.tar.gz'
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: dist.tar.gz
path: dist.tar.gz
Deploy: Deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: Build needs: Build
steps: steps:
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v3 uses: actions/checkout@v3
#- uses: seepine/hash-files@v1 - name: Install NodeJS
- uses: actions/setup-go@v3 uses: actions/setup-node@v3
with: with:
go-version: '>=1.20.1' node-version: '18'
- uses: https://gitea.com/actions/go-hashfiles@v0.0.1 - name: Install Dependencies
id: get-cache-hash run: npm ci
with: - name: Build
patterns: |- run: npm run build
package-lock.json
- name: Show key future key value
run: echo "deps-node-modules-${{ steps.get-cache-hash.outputs.hash }}"
- name: Setup Chache
uses: actions/cache@v3
with:
path: ~/.npm
key: deps-node-modules-${{ steps.get-cache-hash.outputs.hash }}
- name: Access Artifacts
uses: actions/download-artifact@v3
with:
name: dist.tar.gz
- name: Output JS Filename from Build Job
# needs can access all previous jobs an their outputs if the current job is in their 'needs' chain
# js-file -> The output key defined in the Build job outputs area
run: echo "${{ needs.build.outputs.js-file }}"
- name: Deploy - name: Deploy
run: | run: |
echo Deploying... echo Deploying...
ls sleep 1
echo DONE! echo ...
#Notify-Commiter-Error: sleep 1
# needs: Deploy echo ...
# runs-on: ubuntu-latest sleep 1
# if: ${{ failure() }} echo DONE!
# steps:
# - name: Blame commiter
# run: echo "OMG YOU BROKE THE BUILD!!! FIX IT"
-54
View File
@@ -1,54 +0,0 @@
name: List Runner Tool Cache (Persistent)
on:
push:
branches:
- main
workflow_dispatch:
jobs:
check-tool-cache:
runs-on: ubuntu-latest # Or your runner label
# Define the container that runs your steps
container:
image: node:16-bullseye # A common image used with act-runner, or your custom image
volumes:
# Map the persistent 'act-toolcache' Docker volume from your host
# to the /toolcache path inside this job container.
# This makes the /toolcache directory persistent.
- act-toolcache:/toolcache
env:
# This variable now tells nektos/act to use the path where the persistent
# volume is mounted.
RUNNER_TOOL_CACHE: /toolcache
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
- name: List contents of /toolcache
run: |
echo "--- Listing contents of /toolcache ---"
ls -F /toolcache || echo "/toolcache does not exist or is empty"
- name: List contents of /toolcache/go
run: |
echo "--- Listing contents of /toolcache/go ---"
ls -F /toolcache/go || echo "/toolcache/go does not exist or is empty"
- name: List contents of /opt/hostedtoolcache (for comparison - will likely be empty if not explicitly mounted here)
run: |
echo "--- Listing contents of /opt/hostedtoolcache (for comparison) ---"
ls -F /opt/hostedtoolcache || echo "/opt/hostedtoolcache does not exist or is empty"
- name: Verify Go installation (optional)
run: |
echo "--- Verifying Go installation ---"
go version
-37
View File
@@ -1,37 +0,0 @@
name: Test Gitea Actions support Matrix?
on: push
jobs:
build:
strategy:
matrix:
# This will let the build run with all combinations of the following variables
# In this case there can be up to 4 builds (2 windows runner builds and 2 ubuntu runner builds)
# Keys can be self defined (except: include & exclude)
node-version: [14, 16]
supported-os: [ubuntu-latest, windows-latest]
# The following block will ad a 5th using node version 18 with ubuntu (which is not in the above matrix by default)
# This way there would be no Windows Node 18 build for example
include:
- node-version: 18
supported-os: ubuntu-latest
# Like include it is also possible to exclude combinations.
exclude:
- node-version: 14
supported-os: windows-latest
- node-version: 16
supported-os: windows-latest
# Uses the defined supported-os variable from above depending on which of the 6 builds the runner gets
runs-on: ${{ matrix.supported-os }}
steps:
- name: Get Code
uses: actions/checkout@v3
- name: Install NodeJS
uses: actions/setup-node@v3
with:
# Uses the defined node-version variable from above depending on which of the 6 builds the runner gets
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
+11 -16
View File
@@ -1,24 +1,19 @@
name: Output Information name: Output Information
on: on:
push:
pull_request: pull_request:
types: [opened, edited, closed, reopened, synchronize] types: [opened, edited]
issues:
types: [opened, edited, closed, reopened, deleted]
jobs: jobs:
info: info:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Code - name: Output GITEA Context
uses: actions/checkout@v3 run: echo "${{toJSON(gitea.event)}}"
- name: Check Command support - name: Output JOB Context
run: | run: echo "${{toJSON(job)}}"
find -name "package-lock.json" -not -path "**/node_modules/*" - name: Output JOBS Context
find -type f -name "package-lock.json" -not -path "**/node_modules/*" -exec md5sum "{}" + > checklist.chk run: echo "${{toJSON(jobs)}}"
cat checklist.chk - name: Output STEPS Context
find -type f -name "package-lock.json" -not -path "**/node_modules/*" -exec md5sum "{}" + | md5sum | awk '{print $1}' run: echo "${{toJSON(steps)}}"
- name: Because - name: Output RUNNER Context
run: echo "${{gitea.event.action)}}" run: echo "${{toJSON(runner)}}"
- name: Output Event Details
run: echo "${{toJSON(gitea.event)}}"
-15
View File
@@ -1,15 +0,0 @@
name: Reusable Workflow
on:
workflow_call: # does not work on Gitea yet (17.07.2023) So GitHub only for now
inputs:
person:
description: The name of the person who gets mentioned
required: false
default: Chuck Norris
jobs:
do-common-stuff:
runs-on: ubuntu-latest
steps:
- name: Chuck Norris
run: echo "${{inputs.person}} can browse the whole internet offline"
+1 -1
View File
@@ -1,3 +1,3 @@
# test # test
test lol upsi test test lol upsi
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React usw</title> <title>Vite + React</title>
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
+1 -1
View File
@@ -1 +1 @@
test lol test