Account Integration Logic #39
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: Build and Publish Docker Images | |
on: | |
push: | |
branches: | |
- main # Change this to your default branch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
architecture: [linux/amd64, linux/arm64] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Fetch version number from manifest | |
id: get_version | |
run: | | |
version=$(grep -oP '"version": "\K[^"]+' manifest.json) | |
echo "VERSION=${version}" >> $GITHUB_ENV | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
version: latest # Optional: specify the version of buildx if needed, or leave it as default | |
- name: Build and push Docker image | |
run: | | |
# Create a new builder instance with support for multi-platform | |
docker buildx create --use | |
# Build and push Docker image for both architectures (ensure correct context path) | |
docker buildx build \ | |
--platform linux/amd64,linux/arm64 \ | |
-t asaddon/einthusantv:${{ env.VERSION }} \ | |
-t asaddon/einthusantv:latest \ | |
--file Docker/Dockerfile \ | |
--push . # Ensure the correct build context is provided (current directory in this case) |