Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yao177 authored Feb 6, 2024
1 parent c5fdf94 commit 5d3afbb
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Get current date
id: date
run: echo "::set-output name=today::$(date +'%Y-%m-%d_%H-%M')"
- uses: actions/checkout@v4

# 登录到GitHub Container Registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -29,12 +26,5 @@ jobs:
- name: Build the Docker image
run: docker build --tag ghcr.io/${{ github.repository }}:latest

- name: add date tag
run: docker tag ghcr.io/${{ github.repository }}:latest ghcr.io/${{ github.repository }}:${{ steps.date.outputs.today }}

# 推送镜像到GitHub Container Registry
- name: Push the Docker image
run: docker push ghcr.io/${{ github.repository }}:${{ steps.date.outputs.today }}

- name: Push latest tag
run: docker push ghcr.io/${{ github.repository }}:latest

0 comments on commit 5d3afbb

Please sign in to comment.