Skip to content

Commit

Permalink
Merge pull request #26 from CCMA-Enginyeria/main
Browse files Browse the repository at this point in the history
build: Publish docker image with Github actions
  • Loading branch information
paulhiggs authored Aug 23, 2024
2 parents a6e386b + 203960a commit 8d92654
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish Docker image

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build Docker image
run: |
repo_name=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
docker build -t ghcr.io/${repo_name}/dvb-i-tools:latest .
- name: Push Docker image to GitHub Container Registry
run: |
repo_name=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
docker push ghcr.io/${repo_name}/dvb-i-tools:latest
7 changes: 2 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
version: '1.0'
volumes:
node_modules:
services:
dvb-i-tools:
# Comment build and uncomment image if you want to use prebuilt image rather than build from the source code
build: .
#image: ghcr.io/ccma-enginyeria/dvb-i-tools/dvb-i-tools:latest
environment:
- no_proxy=localhost,127.0.0.1
volumes:
- "${GIT_CLONE_PATH:-./}:/usr/src/app"
- node_modules:/usr/src/app/node_modules
ports:
- "3030:3030"

0 comments on commit 8d92654

Please sign in to comment.