Skip to content

Commit

Permalink
[update] 🐭 docker ci test
Browse files Browse the repository at this point in the history
  • Loading branch information
jhao104 committed Dec 31, 2021
1 parent 67ae26a commit 7d079de
Showing 1 changed file with 27 additions and 15 deletions.
42 changes: 27 additions & 15 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
name: Docker Image CI
name: Publish Docker image

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [published]

jobs:

build:

push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build . --file Dockerfile --tag jhao104/proxy_pool:$(date +%s)
- name: DockerHub Login
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Check out the repo
uses: actions/checkout@v2

- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: jhao104/proxy_pool

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 7d079de

Please sign in to comment.