Build #43
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 | |
on: | |
workflow_dispatch: | |
workflow_call: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
# 1️⃣ Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# 2️⃣ Set up Docker Buildx | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# 3️⃣ Log in to GitHub Container Registry | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.MY_GITHUB_TOKEN }} | |
# 4️⃣ Build & push Backend image (Multi-Platform) | |
- name: Build & Push Backend Image | |
run: | | |
docker buildx build \ | |
--platform linux/amd64,linux/arm64 \ | |
--push \ | |
-t ghcr.io/${{ github.repository_owner }}/idrive-backend:latest \ | |
./backend | |
# 5️⃣ Build & push Nginx image (Multi-Platform) | |
- name: Build & Push Nginx Image | |
run: | | |
docker buildx build \ | |
--platform linux/amd64,linux/arm64 \ | |
--push \ | |
-t ghcr.io/${{ github.repository_owner }}/idrive-nginx:latest \ | |
./frontend |