首页 > 解决方案 > 如何使用 github 操作部署 tar.gz 格式的图像

问题描述

我有一个构建到图像中的容器,并压缩为具有不同名称的 .tar.gz。所以,我的图像是 postgres/db:1 - 我将它保存为 pga.tar.gz 在我的存储库中。

我正在尝试使用 github 操作将其添加到我的数字海洋注册表中。

似乎解压缩工作了..但我挂断了标签:

Run docker tag pga registry.digitalocean.com/abda-containers/abd_db1:77
Error response from daemon: No such image: pga:latest
Error: Process completed with exit code 1.

我已经尝试了所有组合,但它不起作用......所以,我在想它可能没有解压缩对吗??

name: unzip and publish to DO

on:
  workflow_dispatch:
    inputs:
      version:
        description: 'Image version'
        required: true

jobs:
  build_and_push:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the repo 
        uses: actions/checkout@v2
      - name: Unzip image 
        run: tar -zxvf pga.tar.gz
      - name: Install doctl
        uses: digitalocean/action-doctl@v2
        with:
          token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
      - name: Log in to DO Container Registry 
        run: doctl registry login --expiry-seconds 600
      - name: Tag image 
        run:
          docker tag pga/
          registry.digitalocean.com/abda-containers/abd_db1:${{github.event.inputs.version }}
      - name: Push image to DO Container Registry 
        run: docker push registry.digitalocean.com/abda-containers/abd_db1:${{ github.event.inputs.version }}

标签: dockeryamlgithub-actionspodman

解决方案


推荐阅读