Skip to content

🌰针对不同的镜像仓库使用不同的仓库名称 #4

🌰针对不同的镜像仓库使用不同的仓库名称

🌰针对不同的镜像仓库使用不同的仓库名称 #4

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push Docker image with version
run: |
ref_name=$(echo "${{ github.ref }}" | sed -e 's,refs/heads/,,g' -e 's,refs/tags/,,g')
docker build . -t johnserfseed/tiktokweb:$ref_name
docker push johnserfseed/tiktokweb:$ref_name