Update README.md #34
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 Push Docker Image 📦 | |
on: | |
push: | |
branches: ['main'] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
docker: | |
name: 🏗️ Build and Push | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🛒 Checkout repository | |
uses: actions/checkout@v3 | |
- name: 🖥️ Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: 🏗️ Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: 🔑 Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: 🏷️ Extract metadata for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: connect211/norse | |
tags: latest | |
- name: 🐳 Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: ✅ Verify Docker image | |
run: | | |
docker pull connect211/norse:latest | |
docker inspect connect211/norse:latest | |
- name: 📨 Notify on success | |
if: success() | |
run: echo "✅ Docker image built and pushed successfully!" | |
- name: 📨 Notify on failure | |
if: failure() | |
run: echo "❌ Docker image build or push failed!" |