Skip to content

Build and publish

Build and publish #12

Workflow file for this run

name: Build and publish
on:
workflow_dispatch:
push:
branches:
- "main" # Running this workflow only for main branch
jobs:
build-and-publish-latest:
runs-on: self-hosted
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Print working directory
run: pwd
- name: List files in working directory
run: ls -la
- name: Verify login to GitHub Container Registry
run: |
echo "Checking authentication to ghcr.io"
docker login ghcr.io -u ${{ github.repository_owner }} -p ${{ secrets.GITHUB_TOKEN }}
docker inspect ghcr.io/RPA-US/screenrpa:latest || echo "Image may not exist, but authentication is working"
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
context: /screenrpa
push: true
file: /screenrpa/docker/nvidia.Dockerfile
tags: ghcr.io/RPA-US/screenrpa:latest
build-args: |
POSTGRES_USER=${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_DB=${{ secrets.POSTGRES_DB }}
DB_NAME=${{ secrets.DB_NAME }}
DB_HOST=${{ secrets.DB_HOST }}
DB_PORT=${{ secrets.DB_PORT }}
DB_USER=${{ secrets.DB_USER }}
DB_PASSWORD=${{ secrets.DB_PASSWORD }}
EMAIL_HOST_USER=${{ secrets.EMAIL_HOST_USER }}
EMAIL_HOST_PASSWORD=${{ secrets.EMAIL_HOST_PASSWORD }}