Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,30 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

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

- name: Set Docker tags
id: docker_meta
run: |
TAGS="${{ env.DOCKER_IMAGE }}:${{ github.sha }}"
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "DOCKER_TAGS=${DOCKER_IMAGE}:latest" >> $GITHUB_ENV
TAGS+=" ${{ env.DOCKER_IMAGE }}:latest"
elif [ "${{ github.ref }}" = "refs/heads/testing" ]; then
echo "DOCKER_TAGS=${DOCKER_IMAGE}:testing" >> $GITHUB_ENV
TAGS+=" ${{ env.DOCKER_IMAGE }}:testing"
fi
echo "DOCKER_TAGS=$TAGS" >> $GITHUB_ENV

- name: Build Docker Image
run: |
docker build -t ${{ env.DOCKER_TAGS }} .

- name: Push Docker Image
- name: Build and Push Multi-Platform Image
run: |
docker push ${{ env.DOCKER_TAGS }}
docker buildx create --use
docker buildx build --platform ${{ env.PLATFORMS }} \
--tag ${{ env.DOCKER_IMAGE }}:${{ github.sha }} \
--tag ${{ env.DOCKER_IMAGE }}:latest \
--push .
Loading