mirror of
https://github.com/imjasonh/testoidc
synced 2026-07-11 15:39:49 +00:00
39 lines
1 KiB
YAML
39 lines
1 KiB
YAML
name: CI
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
permissions:
|
|
id-token: write # undocumented OIDC support.
|
|
packages: write
|
|
contents: read
|
|
env:
|
|
COSIGN_EXPERIMENTAL: "true"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Log into ghcr.io
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
|
- name: Install Cosign
|
|
uses: sigstore/cosign-installer@main
|
|
- name: Build and Push container images
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: |
|
|
ghcr.io/lukehinds/cosign-oidc:${{ github.sha }}
|
|
- name: Sign image
|
|
run: |
|
|
cosign sign ghcr.io/lukehinds/cosign-oidc:${{ github.sha }}
|