Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
fanmingming authored Aug 25, 2024
1 parent fcea953 commit 24c1f4a
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ jobs:
# Step 1: Checkout the repository
- uses: actions/checkout@v4

# Step 2: Log in to Docker Hub
# Step 2: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Step 3: Log in to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# Step 3: Set the image tag
# Step 4: Set the image tag
- name: Set IMAGE_TAG
id: vars
run: echo "IMAGE_TAG=$(date +%s)" >> $GITHUB_ENV

# Step 4: Build the Docker image
- name: Build the Docker image
run: docker build . --file Dockerfile --tag udpxy:${{ env.IMAGE_TAG }}

# Step 5: Tag the Docker image
- name: Tag the Docker image
run: docker tag udpxy:${{ env.IMAGE_TAG }} ${{ secrets.DOCKER_USERNAME }}/udpxy:latest

# Step 6: Push the Docker image to Docker Hub
- name: Push the Docker image to Docker Hub
run: docker push ${{ secrets.DOCKER_USERNAME }}/udpxy:latest
# Step 5: Build and push multi-platform Docker image
- name: Build and push Docker image
run: |
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 \
--tag ${{ secrets.DOCKER_USERNAME }}/udpxy:${{ env.IMAGE_TAG }} \
--tag ${{ secrets.DOCKER_USERNAME }}/udpxy:latest \
--push .

0 comments on commit 24c1f4a

Please sign in to comment.