This repository has been archived by the owner on Jun 5, 2024. It is now read-only.
Merge pull request #6 from suyiiyii/dev #20
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: Docker Image CI | |
on: | |
push: | |
branches: ["master", "dev"] | |
pull_request: | |
branches: ["master"] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: [self-hosted, linux, x64] | |
env: | |
# 定义镜像标签,为"commit id" | |
IMAGE_TAG: ${{ github.sha }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build the Docker imag | |
run: docker build . --file Dockerfile --tag ${{ secrets.REPOSITORY }}:${{ env.IMAGE_TAG }} | |
- name: Login to Registry | |
run: echo "${{ secrets.REPOSITORY_PASSWORD }}" | docker login -u "${{ secrets.REPOSITORY_USERNAME }}" --password-stdin ${{ secrets.REGISTRY }} | |
- name: Push the Docker image | |
run: docker push ${{ secrets.REPOSITORY }}:${{ env.IMAGE_TAG }} |