Use elevated privileges only when needed #123
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: Main berserker CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
lint-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check code formatting | |
run: cargo fmt --check | |
- name: Run clippy | |
run: cargo clippy | |
- name: Run tests | |
run: cargo test | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- run: make | |
- name: Get tag | |
run: | | |
TAG="$(make tag)" | |
echo "TAG=$TAG" >> $GITHUB_ENV | |
- name: Retag and push stackrox-io | |
uses: stackrox/actions/images/retag-and-push@v1 | |
with: | |
src-image: berserker | |
dst-image: quay.io/rhacs-eng/qa:berserker-${{ env.TAG }} | |
username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }} | |
password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }} | |