-
Notifications
You must be signed in to change notification settings - Fork 338
51 lines (43 loc) · 1.25 KB
/
docker_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Build and Push Docker Image
# https://github.com/sigstore/cosign
on:
workflow_dispatch:
inputs:
tag:
description: 'Docker image tag'
required: true
default: 'latest'
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install cosign
uses: sigstore/cosign-installer@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
opentensorfdn/bittensor:${{ github.event.inputs.tag }}
opentensorfdn/bittensor:latest
provenance: false
- name: Sign the images with GitHub OIDC Token
env:
DIGEST: ${{ steps.build.outputs.digest }}
TAGS: ${{ steps.build.outputs.tags }}
run: |
echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}