Skip to content

Commit

Permalink
Push Docker image to https://ghcr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
sistracia committed May 18, 2024
1 parent d54b660 commit 5dc9a35
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/deploy.ghcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy

on:
push:
tags:
- 'ghcr-*'

jobs:
push_to_registries:
name: Push Docker image to multiple registries
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4

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

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}

- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
context: ./web
file: ./web/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy
on:
push:
tags:
- '**'
- 'private-*'

jobs:
deployment:
Expand Down
15 changes: 15 additions & 0 deletions web/docker-compose.registry.ghcr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
services:
web:
image: ghcr.io/sistracia/rss-bookmarkr:main
container_name: rss-bookmarkr
restart: unless-stopped
network_mode: "host"
env_file:
- .env
watchtower:
image: containrrr/watchtower:1.7.1
container_name: rss-bookmarkr-watchtower
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --interval=30 --cleanup=true rss-bookmarkr
File renamed without changes.

0 comments on commit 5dc9a35

Please sign in to comment.