Improve repository structure #969
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: Autha/bazel | |
on: | |
workflow_dispatch: # Allow manual runs. | |
pull_request: | |
branches: [ 'master' ] | |
push: | |
branches: [ 'master' ] | |
jobs: | |
bazel: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: ubuntu-latest | |
name: Linux Ubuntu | |
name: Build (${{ matrix.name || matrix.target }}) | |
runs-on: ${{ matrix.target }} | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Mount bazel cache | |
uses: actions/cache@v3 | |
with: | |
path: "~/.cache/bazel" | |
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', 'MODULE', 'Cargo.Bazel.lock') }} | |
restore-keys: | | |
${{ runner.os }}-bazel- | |
- name: Build Autha | |
run: bazel build //api/autha --strip=always --compilation_mode opt | |
shell: bash | |
- name: Run tests | |
run: bazel test //api/autha:autha_test --strip=always --compilation_mode opt | |
shell: bash | |
- name: Login to GitHub Container Registry | |
if: ${{ github.ref == 'refs/heads/master' }} | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push to docker.io | |
if: ${{ github.ref == 'refs/heads/master' }} | |
run: bazel run //api/autha:push --strip=always --compilation_mode opt | |
shell: bash |