name: Publish Docker images on: push: branches: - main workflow_dispatch: permissions: contents: read packages: write jobs: build-and-push: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: docker/setup-buildx-action@v3 - name: Log in to GitHub Container Registry uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GH_TOKEN }} - name: Build and push backend image uses: docker/build-push-action@v5 with: context: ./backend push: true tags: ghcr.io/${{ github.repository_owner }}/xslt-playground-backend:latest - name: Make backend image public env: GH_TOKEN: ${{ secrets.GH_TOKEN }} OWNER: ${{ github.repository_owner }} PACKAGE: xslt-playground-backend run: | gh api -X PATCH /users/alexandrev/packages/container/$PACKAGE --field visibility=public - name: Build and push frontend image uses: docker/build-push-action@v5 with: context: ./frontend push: true tags: ghcr.io/${{ github.repository_owner }}/xslt-playground-frontend:latest - name: Make frontend image public env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} OWNER: ${{ github.repository_owner }} PACKAGE: xslt-playground-frontend run: | gh api -X PATCH /users/alexandrev/packages/container/$PACKAGE --field visibility=public