refactor protobuf definitions and add head overlay attribute (#16) #11
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: Create and publish Docker image | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
actions: read | |
security-events: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Login into GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login into Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
scrayosug/xenos | |
ghcr.io/scrayosnet/xenos | |
tags: | | |
type=ref,event=branch | |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Scan vulnerabilities with Docker Scout | |
id: docker-scout | |
uses: docker/scout-action@v1 | |
with: | |
command: cves | |
sarif-file: sarif.output.json | |
exit-code: true | |
summary: true | |
- name: Upload SARIF result | |
id: upload-sarif | |
if: ${{ github.event_name != 'pull_request_target' }} | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: sarif.output.json |