michalvankodev-site/.gitea/workflows/release.yaml

55 lines
1.3 KiB
YAML
Raw Normal View History

2024-09-17 21:38:04 +02:00
name: release
2024-09-18 12:50:28 +02:00
on:
push:
branches:
main
2024-09-17 21:38:04 +02:00
2024-09-17 21:59:33 +02:00
env:
PORT: 3081
2024-09-17 21:38:04 +02:00
jobs:
release:
name: release
runs-on: ubuntu-latest
2024-09-18 16:20:33 +02:00
container: ubuntu
2024-09-17 21:38:04 +02:00
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
2024-09-18 12:47:25 +02:00
- name: cache
uses: Swatinem/rust-cache@v2
working-directory: axum_server
2024-09-17 21:48:34 +02:00
- uses: taiki-e/install-action@just
2024-09-18 13:10:06 +02:00
# - uses: JarvusInnovations/background-action@v1
# with:
# run: just prod &
# working-directory: axum_server
# wait-on: http://localhost:3081
# wait-for: 10m
# tail: true
2024-09-18 15:10:59 +02:00
- name: Build release
run: cargo build --release
working-directory: axum_server
- name: Run server in background
2024-09-18 16:04:07 +02:00
run: just prod &
2024-09-18 15:10:59 +02:00
working-directory: axum_server
2024-09-18 15:20:24 +02:00
- uses: cygnetdigital/wait_for_response@v2.0.0
with:
2024-09-18 16:04:07 +02:00
url: 'http://127.0.0.1:3081/'
2024-09-18 15:20:24 +02:00
responseCode: '200,500'
2024-09-18 15:37:02 +02:00
timeout: 50000
interval: 2000
2024-09-18 12:56:49 +02:00
- name: run ssg
run: just ssg
working-directory: axum_server
2024-09-18 13:17:18 +02:00
- name: Server log
run: cat axum_server/server.log
2024-09-17 21:38:04 +02:00
- uses: actions/upload-artifact@v4
with:
name: dist
path: axum_server/dist/
retention-days: 10