diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..d9bd5b1 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index f4c4a3f..c9f6227 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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" \ No newline at end of file