implement server bans #119
This file contains hidden or 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: Generate sqlx data & doc | |
| on: | |
| push: | |
| branches: | |
| - main | |
| env: | |
| CARGO_TERM_COLOR: always | |
| CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
| jobs: | |
| sqlx: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:latest | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup cache | |
| id: rust-cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install sqlx-cli | |
| if: steps.rust-cache.outputs.cache-hit != 'true' | |
| run: cargo install sqlx-cli --no-default-features --features rustls,postgres | |
| - run: cargo sqlx mig run && cargo sqlx prepare -- --all-features | |
| env: | |
| DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/postgres" | |
| - name: Commit sqlx-data.json | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add . | |
| git commit -m "Update sqlx-data.json" || true | |
| git push || true | |
| deploy: | |
| needs: sqlx | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup cache | |
| uses: Swatinem/rust-cache@v2 | |
| - run: cargo doc --all-features --workspace --no-deps | |
| - run: echo "<meta http-equiv=\"refresh\" content=\"0; url=essence\">" > target/doc/index.html | |
| - run: cp -r target/doc ./docs | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v2 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v1 | |
| with: | |
| path: ./docs | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v1 |