Skip to content

Commit

Permalink
添加scancode-toolkit镜像构建脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlkl committed Jun 16, 2023
1 parent 1e3e25c commit a22b472
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/deploy-scancode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Create and publish scancode image

on:
push:
tags:
- "scancode-toolkit/v*"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/scancode-toolkit

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
repository: nexB/scancode-toolkit

- name: Log in to the Container registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@05d22bf31770de02e20c67c70365453e00227f61
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=match,pattern=scancode-toolkit/v(\d+\.\d+\.\d+),group=1
- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit a22b472

Please sign in to comment.