Update README.md #23
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: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository | |
- uses: actions/checkout@v4 | |
# 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 4: Set the image tag | |
- name: Set IMAGE_TAG | |
id: vars | |
run: echo "IMAGE_TAG=$(date +%s)" >> $GITHUB_ENV | |
# 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 . |