3 Commits

Author SHA1 Message Date
tom.coursow 800ebc414c „test.txt“ ändern
Gitea Actions Demo / Build (push) Successful in 38s
Gitea Actions Demo / Deploy (push) Successful in 39s
2023-07-12 19:53:39 +02:00
tom.coursow a826a6b742 „README.md“ ändern
Gitea Actions Demo / Build (push) Successful in 36s
Gitea Actions Demo / Deploy (push) Successful in 38s
Output Information / info (pull_request) Successful in 10s
2023-07-12 19:48:57 +02:00
tom.coursow 1636c042c3 „README.md“ ändern 2023-07-12 19:48:57 +02:00
8 changed files with 30 additions and 220 deletions
+15 -94
View File
@@ -1,120 +1,41 @@
# .gitea/workflows/build.yaml
name: Build Workflow
on:
workflow_dispatch:
push:
branches:
- main
#paths-ignore:
# - '.gitea/workflows/*'
name: Gitea Actions Demo
run-name: ${{ github.actor }} is testing out Gitea Actions 🚀
on: [workflow_dispatch, push]
jobs:
Build:
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:
# 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
uses: actions/checkout@v3
- name: Install NodeJS
uses: actions/setup-node@v3
with:
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
run: npm ci
- name: Run Tests
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:
runs-on: ubuntu-latest
needs: Build
steps:
- name: Checkout Code
uses: actions/checkout@v3
#- uses: seepine/hash-files@v1
- uses: actions/setup-go@v3
- name: Install NodeJS
uses: actions/setup-node@v3
with:
go-version: '>=1.20.1'
- 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
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 }}"
node-version: '18'
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
- name: Deploy
run: |
echo Deploying...
ls
sleep 1
echo ...
sleep 1
echo ...
sleep 1
echo DONE!
#Notify-Commiter-Error:
# needs: Deploy
# runs-on: ubuntu-latest
# if: ${{ failure() }}
# 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
+10 -15
View File
@@ -1,24 +1,19 @@
name: Output Information
on:
push:
pull_request:
types: [opened, edited, closed, reopened, synchronize]
issues:
types: [opened, edited, closed, reopened, deleted]
types: [opened, edited, closed, reopened]
jobs:
info:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Check Command support
run: |
find -name "package-lock.json" -not -path "**/node_modules/*"
find -type f -name "package-lock.json" -not -path "**/node_modules/*" -exec md5sum "{}" + > checklist.chk
cat checklist.chk
find -type f -name "package-lock.json" -not -path "**/node_modules/*" -exec md5sum "{}" + | md5sum | awk '{print $1}'
- name: Because
run: echo "${{gitea.event.action)}}"
- name: Output Event Details
- name: Output GITEA Context
run: echo "${{toJSON(gitea.event)}}"
- name: Output JOB Context
run: echo "${{toJSON(job)}}"
- name: Output JOBS Context
run: echo "${{toJSON(jobs)}}"
- name: Output STEPS Context
run: echo "${{toJSON(steps)}}"
- name: Output RUNNER Context
run: echo "${{toJSON(runner)}}"
-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 lol upsi test
test lol upsi
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React usw</title>
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
+1 -1
View File
@@ -1 +1 @@
test lol
test bip bup