load file's creation time (#32) #189
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI and CD | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
ci-backend: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23.x' | |
- name: Run unit tests | |
run: | | |
cd ./backend && go test ./... -v -race -cover | |
cd-backend: | |
runs-on: ubuntu-latest | |
needs: | |
- ci-backend | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- name: deploy to production | |
env: | |
LIARA_TOKEN: ${{ secrets.LIARA_API_TOKEN }} | |
LIARA_BACKEND_APP_NAME: ${{secrets.LIARA_BACKEND_APP_NAME}} | |
LIARA_FRONTEND_APP_NAME: ${{secrets.LIARA_FRONTEND_APP_NAME}} | |
run: | | |
npm i -g @liara/cli@5 | |
cd ./backend && liara deploy --platform=docker --port="80" --app="$LIARA_BACKEND_APP_NAME" --api-token="$LIARA_TOKEN" --detach | |
cd-frontend: | |
runs-on: ubuntu-latest | |
needs: | |
- cd-backend | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- name: deploy to production | |
env: | |
LIARA_TOKEN: ${{ secrets.LIARA_API_TOKEN }} | |
LIARA_BACKEND_APP_NAME: ${{secrets.LIARA_BACKEND_APP_NAME}} | |
LIARA_FRONTEND_APP_NAME: ${{secrets.LIARA_FRONTEND_APP_NAME}} | |
run: | | |
npm i -g @liara/cli@5 | |
cd ./frontend && liara deploy --platform=docker --port="3000" --app="$LIARA_FRONTEND_APP_NAME" --api-token="$LIARA_TOKEN" --detach |