chore(deps): bump pulldown-cmark from 8b060d5
to 81b23e8
#298
Workflow file for this run
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/CD | |
on: | |
- push | |
- pull_request | |
jobs: | |
test: | |
name: Test | |
permissions: | |
contents: read | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Cache dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Install Chromium | |
uses: browser-actions/setup-chrome@v1 | |
- name: Install Typst | |
run: > | |
curl -L https://github.com/typst/typst/releases/latest/download/typst-x86_64-unknown-linux-musl.tar.xz | tar -xJf - | |
&& mv typst-x86_64-unknown-linux-musl/typst /usr/local/bin/typst | |
- name: Execute tests | |
run: cargo test --all-features --all-targets | |
check: | |
name: Check | |
permissions: | |
contents: read | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: clippy | |
- name: Cache dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Install Chromium | |
uses: browser-actions/setup-chrome@v1 | |
- name: Install Typst | |
run: > | |
curl -L https://github.com/typst/typst/releases/latest/download/typst-x86_64-unknown-linux-musl.tar.xz | tar -xJf - | |
&& mv typst-x86_64-unknown-linux-musl/typst /usr/local/bin/typst | |
- name: Check code | |
run: cargo clippy --all-features --all-targets -- -D warnings | |
format: | |
name: Format | |
permissions: | |
contents: read | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- name: Cache dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Check formatting | |
run: cargo fmt --all -- --check | |
build: | |
name: Build | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
- check | |
- format | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Generate Docker metadata | |
id: docker-metadata | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/vidhanio/site | |
us-east1-docker.pkg.dev/vidhan-io/site/site | |
tags: | | |
type=ref,event=branch | |
type=sha | |
flavor: | | |
latest=true | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to Google Cloud | |
id: gcloud-auth | |
uses: google-github-actions/auth@v2 | |
with: | |
token_format: access_token | |
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ secrets.SERVICE_ACCOUNT }} | |
- name: Login to Google Artifact Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: us-east1-docker.pkg.dev | |
username: oauth2accesstoken | |
password: ${{ steps.gcloud-auth.outputs.access_token }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.docker-metadata.outputs.tags }} | |
labels: ${{ steps.docker-metadata.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
deploy: | |
name: Deploy | |
permissions: | |
contents: read | |
id-token: write | |
environment: | |
name: Production | |
url: https://vidhan.io | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- name: Login to Google Cloud | |
uses: google-github-actions/auth@v2 | |
with: | |
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ secrets.SERVICE_ACCOUNT }} | |
- name: Deploy to Cloud Run | |
id: cloud-run-deploy | |
uses: google-github-actions/deploy-cloudrun@v2 | |
with: | |
service: "site" | |
image: "us-east1-docker.pkg.dev/vidhan-io/site/site:latest" | |
env_vars: | | |
IP=0.0.0.0 | |
PRODUCTION=true | |
region: us-east1 |