push to registry

This commit is contained in:
kaiiak
2022-01-02 23:16:20 +08:00
parent 70d00c1e43
commit ae264e9680

View File

@@ -11,14 +11,14 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Build the Docker image with golang:buster # - name: Build the Docker image with golang:buster
run: docker build . --file Dockerfile.buster --tag opencv-docker-golang:buster # run: docker build . --file Dockerfile.buster --tag opencv-docker-golang:buster
- name: Build the Docker image with ubuntu:20.04 - name: Build the Docker image with ubuntu:20.04
run: docker build . --file Dockerfile.ubuntu --tag opencv-docker-golang:ubuntu run: docker build . --file Dockerfile.ubuntu --tag opencv-docker-golang:ubuntu
- name: Build the Docker image with dlib # - name: Build the Docker image with dlib
run: docker build . --file Dockerfile.dlib --tag opencv-docker-golang:dlib # run: docker build . --file Dockerfile.dlib --tag opencv-docker-golang:dlib
push_to_registries: push_to_registries:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
@@ -29,7 +29,23 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Log in to Docker Hub - name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 uses: docker/login-action@v1.12.0
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3.6.2
with:
images: ${{ github.repository }}
- name: Build and push Docker image
uses: docker/build-push-action@v2.7.0
with:
context: .
push: true
build-args: |
-f=Dockerfile.ubuntu
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}