Build and Push Docker Image #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Push Docker Image | |
on: | |
workflow_dispatch: # 允许手动启动 | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
# 检出仓库代码 | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# 登录 Docker Hub | |
- name: Log in to Docker Hub | |
uses: docker/#-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
# 构建 Docker 镜像 | |
- name: Build Docker Image | |
run: | | |
docker build -t memorycollection/iptv:latest . | |
# 推送 Docker 镜像到 Docker Hub | |
- name: Push Docker Image | |
run: | | |
docker push memorycollection/iptv:latest |