Skip to content

Commit

Permalink
Add GHCR support to workflow [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Dec 4, 2024
1 parent 99b2328 commit 5004b87
Showing 1 changed file with 37 additions and 3 deletions.
40 changes: 37 additions & 3 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
name: Build ARM Docker Image
name: Docker Build

on:
push:
branches: [ main ]
paths:
- 'Dockerfile'
- 'Dockerfile.arm'
- 'requirements.txt'
- 'movie_selector/**'
- '.github/workflows/**'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4

Expand All @@ -25,19 +34,44 @@ jobs:
toolchain: stable
override: true

# Login to both registries
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: sahara101
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
# Build AMD64 image
- name: Build and push AMD64
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
platforms: linux/amd64
push: true
tags: |
sahara101/movie-roulette:latest
sahara101/movie-roulette:v3.0
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:v3.0
# Build ARM image
- name: Build and push ARM
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.arm
platforms: linux/arm64,linux/arm/v7
push: true
tags: |
sahara101/movie-roulette:arm-v3.0
sahara101/movie-roulette:arm-latest
sahara101/movie-roulette:arm-v3.0
ghcr.io/${{ github.repository }}:arm-latest
ghcr.io/${{ github.repository }}:arm-v3.0

0 comments on commit 5004b87

Please sign in to comment.