Merge pull request #52 from TheBestTvarynka/feature/asn1-rendering-im… #62
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: Build & Deploy | |
env: | |
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} | |
GCP_BUCKET: ${{ secrets.GCP_BUCKET }} | |
APP_HOST: ${{ secrets.APP_HOST }} | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
check: | |
name: Check code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: 'Add nightly channel' | |
run: 'rustup toolchain install nightly' | |
- name: 'Add nightly fmt' | |
run: 'rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu' | |
- name: 'Fmt' | |
run: 'cargo +nightly fmt --all -- --check' | |
- name: 'Clippy' | |
run: 'cargo clippy -- -D warnings' | |
- name: 'Tests' | |
run: 'cargo test' | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
needs: check | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: 'Trunk Check' | |
uses: jetli/[email protected] | |
- id: 'auth' | |
name: 'Authenticate to Google Cloud' | |
uses: 'google-github-actions/auth@v0' | |
with: | |
credentials_json: '${{ secrets.GCP_SERVICE_KEY }}' | |
- name: 'Add WASM target' | |
run: 'rustup target add wasm32-unknown-unknown' | |
- name: 'Build' | |
run: 'trunk build --release' | |
- name: 'Set up Cloud SDK' | |
uses: google-github-actions/setup-gcloud@v0 | |
- name: 'Deploy' | |
run: 'gsutil -h "Cache-Control:no-store" -m cp -r dist/* gs://${GCP_BUCKET}' |