Skip to content

Commit

Permalink
feat: github ci
Browse files Browse the repository at this point in the history
  • Loading branch information
a2cd committed Jan 9, 2024
1 parent 37bd213 commit b5d7633
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,25 @@ jobs:
registry: ${{ secrets.REGISTRY_DOMAIN }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ secrets.REGISTRY_DOMAIN }}/a2cd/rs-hello-world:latest
# - name: Build and push Docker image
# uses: docker/build-push-action@v5
# with:
# context: .
# push: true
# tags: ${{ secrets.REGISTRY_DOMAIN }}/a2cd/rs-hello-world:latest
- name: Build and push image
env:
REGISTRY: ${{ secrets.REGISTRY_DOMAIN }}
NAMESPACE: a2cd
IMAGE_NAME: rs-hello-world
IMAGE_TAG: $(date "+%Y%m%d")
run: |
echo "当前路径:"
pwd
echo "文件:"
ls -l
docker build -t $REGISTRY/$NAMESPACE/$IMAGE_NAME:latest .
docker tag -t $REGISTRY/$NAMESPACE/$IMAGE_NAME:latest $REGISTRY/$NAMESPACE/$IMAGE_NAME:$IMAGE_TAG
docker push $REGISTRY/$NAMESPACE/$IMAGE_NAME:latest
docker push $REGISTRY/$NAMESPACE/$IMAGE_NAME:$IMAGE_TAG

0 comments on commit b5d7633

Please sign in to comment.