Implemented forgejo ci
This commit is contained in:
parent
73d0debc1e
commit
83661b9d38
6 changed files with 154 additions and 3 deletions
.forgejo/workflows
67
.forgejo/workflows/build_preview.yml
Normal file
67
.forgejo/workflows/build_preview.yml
Normal file
|
@ -0,0 +1,67 @@
|
|||
on:
|
||||
push:
|
||||
tags:
|
||||
- '[0-9]+\.[0-9]+\.[0-9]+pre[0-9]+'
|
||||
|
||||
jobs:
|
||||
checking:
|
||||
runs-on: docker
|
||||
container: node:lts
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: https://code.forgejo.org/actions/checkout@v3
|
||||
- name: Install packages
|
||||
run: npm install
|
||||
- name: Run astro check (linting + static analysis)
|
||||
run: npm run astro check
|
||||
|
||||
build-site:
|
||||
needs: [checking]
|
||||
if: success()
|
||||
runs-on: dind
|
||||
steps:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: forgejo.neshweb.net
|
||||
username: ${{ secrets.FORGEJO_USERNAME }}
|
||||
password: ${{ secrets.FORGEJO_TOKEN }}
|
||||
- name: Push to Package Registry
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
push: true
|
||||
tags: forgejo.neshweb.net/firq/firq-dev-website:${{ github.ref_name }}, forgejo.neshweb.net/firq/firq-dev-website:preview
|
||||
|
||||
publish:
|
||||
needs: [build-site]
|
||||
if: success()
|
||||
runs-on: docker
|
||||
steps:
|
||||
- name: Release New Version
|
||||
uses: actions/forgejo-release@v1
|
||||
with:
|
||||
direction: upload
|
||||
url: https://forgejo.neshweb.net
|
||||
release-dir: release
|
||||
token: ${{ secrets.FORGEJO_TOKEN }}
|
||||
tag: ${{ github.ref_name }}
|
||||
|
||||
unlighthouse:
|
||||
needs: [publish]
|
||||
if: success()
|
||||
runs-on: docker
|
||||
services:
|
||||
website:
|
||||
image: forgejo.neshweb.net/firq/firq-dev-website:preview
|
||||
steps:
|
||||
- name: Install Dependencies
|
||||
run: npm install -g @unlighthouse/cli puppeteer
|
||||
- name: Run unlighthouse
|
||||
run: unlighthouse-ci --site website:8081
|
||||
- name: Upload reports
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: unlighthouse-reports
|
||||
path: unlighthouse-reports/
|
53
.forgejo/workflows/build_release.yml
Normal file
53
.forgejo/workflows/build_release.yml
Normal file
|
@ -0,0 +1,53 @@
|
|||
on:
|
||||
push:
|
||||
tags:
|
||||
- '[0-9]+\.[0-9]+\.[0-9]+'
|
||||
- '[0-9]+\.[0-9]+\.[0-9]+a[0-9]+'
|
||||
- '[0-9]+\.[0-9]+\.[0-9]+b[0-9]+'
|
||||
- '[0-9]+\.[0-9]+\.[0-9]+rc[0-9]+'
|
||||
|
||||
jobs:
|
||||
checking:
|
||||
runs-on: docker
|
||||
container: node:lts
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: https://code.forgejo.org/actions/checkout@v3
|
||||
- name: Install packages
|
||||
run: npm install
|
||||
- name: Run astro check (linting + static analysis)
|
||||
run: npm run astro check
|
||||
run: npm run astro check
|
||||
|
||||
build-site:
|
||||
needs: [checking]
|
||||
if: success()
|
||||
runs-on: dind
|
||||
steps:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: forgejo.neshweb.net
|
||||
username: ${{ secrets.FORGEJO_USERNAME }}
|
||||
password: ${{ secrets.FORGEJO_TOKEN }}
|
||||
- name: Push to Package Registry
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
push: true
|
||||
tags: forgejo.neshweb.net/firq/firq-dev-website:${{ github.ref_name }}, forgejo.neshweb.net/firq/firq-dev-website:latest
|
||||
|
||||
release:
|
||||
needs: [build-site]
|
||||
if: success()
|
||||
runs-on: docker
|
||||
steps:
|
||||
- name: Release New Version
|
||||
uses: actions/forgejo-release@v1
|
||||
with:
|
||||
direction: upload
|
||||
url: https://forgejo.neshweb.net
|
||||
release-dir: release
|
||||
token: ${{ secrets.FORGEJO_TOKEN }}
|
||||
tag: ${{ github.ref_name }}
|
16
.forgejo/workflows/linting.yml
Normal file
16
.forgejo/workflows/linting.yml
Normal file
|
@ -0,0 +1,16 @@
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- "**"
|
||||
|
||||
jobs:
|
||||
checking:
|
||||
runs-on: docker
|
||||
container: node:lts
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: https://code.forgejo.org/actions/checkout@v3
|
||||
- name: Install packages
|
||||
run: npm install
|
||||
- name: Run astro check (linting + static analysis)
|
||||
run: npm run astro check
|
Loading…
Add table
Add a link
Reference in a new issue