Switch to Gitea Actions for build/publish (#118)

Reviewed-on: https://gitea.com/gitea/website/pulls/118
Co-authored-by: techknowlogick <hello@techknowlogick.com>
Co-committed-by: techknowlogick <hello@techknowlogick.com>
This commit is contained in:
techknowlogick 2023-04-15 02:04:54 +08:00 committed by techknowlogick
parent 9d5992fc9c
commit 4afd74d360
5 changed files with 60 additions and 57 deletions

View File

@ -1,60 +1,3 @@
---
kind: pipeline
type: docker
name: Build and deploy live website
platform:
os: linux
arch: arm64
workspace:
base: /srv/app
path: src
steps:
- name: build
pull: always
image: golang:1.19
commands:
- make clean
- make build
- name: publish
pull: always
image: techknowlogick/drone-netlify:latest
settings:
path: public/
site_id: 05515f14-3702-4a84-9ff3-88ba90fe08dd
environment:
NETLIFY_TOKEN:
from_secret: netlify_token
when:
event:
- push
- name: discord
pull: always
image: appleboy/drone-discord:1
environment:
DISCORD_WEBHOOK_ID:
from_secret: discord_webhook_id
DISCORD_WEBHOOK_TOKEN:
from_secret: discord_webhook_token
when:
event:
- push
- tag
status:
- changed
- failure
trigger:
branch:
- main
event:
exclude:
- pull_request
---
kind: pipeline
type: docker

View File

@ -0,0 +1,36 @@
name: build and publish
on:
push:
branches:
- main
jobs:
lint:
name: build and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: https://github.com/peaceiris/actions-hugo@v2
with:
hugo-version: '0.111.3'
extended: true
- name: setup go
uses: https://github.com/actions/setup-go@v4
with:
go-version: '>=1.20.1'
- name: Build
run: |
make clean
make build
- name: publish to netlify
uses: https://github.com/nwtgck/actions-netlify@v2.0
with:
publish-dir: public
production-branch: main
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: 05515f14-3702-4a84-9ff3-88ba90fe08dd

View File

@ -0,0 +1,24 @@
name: check-and-test
on:
- push
- pull_request
jobs:
check-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Hugo
uses: https://github.com/peaceiris/actions-hugo@v2
with:
hugo-version: '0.111.3'
extended: true
- name: setup go
uses: https://github.com/actions/setup-go@v4
with:
go-version: '>=1.20.1'
- name: Build
run: |
make clean
make build