Skip to content

staging

staging #376

Workflow file for this run

name: staging
on:
schedule:
# https://crontab.guru/#0_1_*_*_*
- cron: '0 1 * * *'
push:
branches: [main]
workflow_dispatch:
jobs:
format:
uses: ./.github/workflows/fmt.yaml
lint:
uses: ./.github/workflows/lint.yaml
build:
uses: ./.github/workflows/build.yaml
test:
uses: ./.github/workflows/test.yaml
publish:
uses: ./.github/workflows/publish.yaml
permissions:
packages: write
secrets: inherit
with:
registry: ghcr.io
username: ${{ github.actor }}
deploy:
runs-on: ubuntu-latest
needs: publish
timeout-minutes: 20
environment:
name: staging
url: https://staging.spaced.fun
steps:
- uses: actions/checkout@v4
- run: |
echo "COMMIT_SHA=${{ github.sha }}" >> .env
echo "LETSENCRYPT_EMAIL=${{ secrets.LETSENCRYPT_EMAIL }}" >> .env
echo "STACK_NAME=staging" >> .env
echo "SUBDOMAIN=staging" >> .env
- uses: ./.github/actions/docker_stack
with:
args: |
deploy staging -c config/docker/services-stack.yaml
deploy root -c config/docker/root-stack.yaml
host: staging.spaced.fun
user: spaced
ssh_key: ${{ secrets.SSH_PRIVATE_KEY }}
env_file: .env
lighthouse:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: deploy
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- run: npx @lhci/cli@0.14 autorun --config config/lighthouserc.cjs
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
e2e:
needs: deploy
uses: ./.github/workflows/e2e.yaml