[Geert Baeke] Use GitHub Actions to build and push a container image [ENG, 2020]


Делаю:
07.11.2021


https://www.youtube.com/watch?v=FYIRvqdP3pQ


Поехали


Форкаем к себе:
https://github.com/gbaeke/python-msi


https://github.com/webmak1/python-msi/settings/secrets/actions


Заданы переменны:

GHCR_PASSWORD
SNYK


build-push.yml

name: Publish Docker Image

on:
    push:
        branches: [master]
    release:
        types:
            - published
jobs:
    build:
        if: "!contains(github.event.head_commit.message, 'skip ci')"
        runs-on: ubuntu-latest

        steps:
            - name: Check out
              uses: actions/[email protected]

            - name: Docker meta
              id: docker_meta
              uses: crazy-max/[email protected]
              with:
                  images: ghcr.io/$/python-msi
                  tag-sha: true
                  tag-edge: false
                  tag-latest: true

            # - name: Set up QEMU
            #   uses: docker/[email protected]

            # - name: Set up Docker Buildx
            #   uses: docker/[email protected]

            - name: Login to GHCR
              uses: docker/[email protected]
              with:
                  registry: ghcr.io
                  username: $
                  password: $

            - name: Build image
              uses: docker/[email protected]
              with:
                  tags: $
                  file: ./Dockerfile

            # - name: Monitor image for vulnerabilities with Snyk
            #   uses: snyk/actions/[email protected]
            #   env:
            #       SNYK_TOKEN: $
            #   with:
            #       command: monitor
            #       image: 'ghcr.io/gbaeke/rgapi:main'
            #       args: --file=Dockerfile --project-name=python-msi

            - name: Push image
              uses: docker/[email protected]
              with:
                  push: true
                  tags: $
                  file: ./Dockerfile


Мдя. Нужно зайти на странице в Packages. Нажать на крестик с “Clear current search query, filters, and sorts”, чтобы отобразились packages.

Вроде догадался. Все из-за того, что по умолчанию packages - приватные!

Интересно, как сделать, чтобы по умолчанию были public?