fix: Update qualitytrace-server-release.yml for action failure #3
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: qualitytrace-server release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
push_to_registry: | |
name: Build and push Docker image github container registry. | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
id-token: write | |
contents: read | |
actions: read | |
security-events: write | |
env: | |
REGISTRY: ghcr.io | |
GH_URL: https://github.com | |
registry_username: ${{ github.actor }} | |
registry_password: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Set environment variable | |
run: | | |
echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV | |
- name: Test environment variable | |
run: echo ${{ env.RELEASE_VERSION }} | |
- name: Check out GitHub repo | |
uses: actions/checkout@v3 | |
- name: Build server | |
run: make dist/qualitytrace-server | |
env: | |
GO111MODULE: on | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ env.registry_username }} | |
password: ${{ env.registry_password }} | |
- name: Build image and push to GitHub Container Registry | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
context: ./ | |
file: ./dockerfiles/server/Dockerfile | |
tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ env.RELEASE_VERSION }} | |
- name: Install cosign | |
uses: sigstore/cosign-installer@main | |
- name: Sign the images | |
run: | | |
cosign sign -y ${{ env.REGISTRY }}/${{ github.repository }}:${{ env.RELEASE_VERSION }} | |
env: | |
COSIGN_EXPERIMENTAL: 1 | |
- name: Verify the pushed tags | |
run: cosign verify ${{ env.REGISTRY }}/${{ github.repository }}:${{ env.RELEASE_VERSION }} --certificate-identity ${{ env.GH_URL }}/${{ github.repository }}/.github/workflows/qualitytrace-server-release.yml@refs/tags/${{ env.RELEASE_VERSION }} --certificate-oidc-issuer https://token.actions.githubusercontent.com | |
env: | |
COSIGN_EXPERIMENTAL: 1 | |
- name: Run Trivy in GitHub SBOM mode and submit results to Dependency Graph | |
uses: aquasecurity/trivy-action@master | |
with: | |
scan-type: 'fs' | |
format: 'github' | |
output: 'dependency-results.sbom.json' | |
image-ref: '.' | |
github-pat: ${{ env.registry_password }} # or ${{ secrets.github_pat_name }} if you're using a PAT |