From e7a9f825e384a08112fca25f5c90e94dfff84152 Mon Sep 17 00:00:00 2001 From: Reese Norris Date: Tue, 22 Oct 2024 11:51:49 -0700 Subject: [PATCH] create docker-build-and-publish.yml --- .../workflows/docker-build-and-publish.yml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/docker-build-and-publish.yml diff --git a/.github/workflows/docker-build-and-publish.yml b/.github/workflows/docker-build-and-publish.yml new file mode 100644 index 0000000..8eca7d9 --- /dev/null +++ b/.github/workflows/docker-build-and-publish.yml @@ -0,0 +1,40 @@ +name: Build and Publish Docker Image + +on: + push: + branches: + - main + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: arm64,amd64 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + id: buildx + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push Docker images + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/openfsd:latest + + - name: Logout from Docker Hub + run: docker logout