From a22b4729f2ce634f62742e17718d3f560bd1dfda Mon Sep 17 00:00:00 2001 From: kunlongli Date: Fri, 16 Jun 2023 19:27:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0scancode-toolkit=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E6=9E=84=E5=BB=BA=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-scancode.yml | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/deploy-scancode.yml diff --git a/.github/workflows/deploy-scancode.yml b/.github/workflows/deploy-scancode.yml new file mode 100644 index 0000000..a2057b8 --- /dev/null +++ b/.github/workflows/deploy-scancode.yml @@ -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 }} +