Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
fix: move from docker hub to GHCR
Browse files Browse the repository at this point in the history
  • Loading branch information
cecilia-sanare committed Apr 10, 2024
1 parent 19689f5 commit 81bc443
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 26 deletions.
24 changes: 7 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

deploy-docker:
name: Deploy (Docker Hub)
name: Deploy (Docker)
runs-on: ubuntu-latest
needs: semantic
if: needs.semantic.outputs.published == 'true'
Expand All @@ -141,17 +141,17 @@ jobs:
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: rainbowcafe/silvy
images: ghcr.io/ribbon-studios/silvy
tags: |
type=raw,value=${{ needs.semantic.outputs.major }}
type=raw,value=${{ needs.semantic.outputs.major }}.${{ needs.semantic.outputs.minor }}
Expand All @@ -165,16 +165,6 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Push README to Dockerhub
uses: christian-korneck/update-container-description-action@v1
env:
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASS: ${{ secrets.DOCKER_PASSWORD }}
with:
destination_container_repo: rainbowcafe/silvy
provider: dockerhub
readme_file: 'README.md'

deploy-netlify:
name: Deploy (Netlify)
runs-on: ubuntu-latest
Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
_**⚠️ This repo is still a WIP and things are always subject to change. ⚠️**_

[![Docker Hub Version](https://img.shields.io/docker/v/rainbowcafe/silvy?label=Docker%20Hub%20Version)](https://hub.docker.com/repository/docker/rainbowcafe/silvy)

[![Coveralls](https://img.shields.io/coveralls/github/rain-cafe-xiv/silvy)](https://coveralls.io/github/rain-cafe-xiv/silvy)
[![Coveralls](https://img.shields.io/coveralls/github/ribbon-studios/silvy)](https://coveralls.io/github/ribbon-studios/silvy)

## Silvy

Expand Down Expand Up @@ -34,8 +32,8 @@ $ docker run -d \
-e DISCORD_CLIENT_ID="<your-discord-client-id>" \
-e DISCORD_SECRET="<your-discord-token>" \
-e DATABASE_URL="<your-database-url>" \
--name discord-bot \
rainbowcafe/silvy
--name silvy \
ghcr.io/ribbon-studios/silvy:latest
```

#### 🐋 Docker Compose
Expand All @@ -44,9 +42,9 @@ $ docker run -d \
version: "3"

services:
discord-bot:
image: rainbowcafe/silvy:latest
container_name: discord-bot
silvy:
image: ghcr.io/ribbon-studios/silvy:latest
container_name: silvy
tty: true
stdin_open: true
restart: unless-stopped
Expand Down
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
description = "Silvy";

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

outputs = { nixpkgs, ... }: let
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
in {
# Devshell for bootstrapping; acessible via 'nix develop' or 'nix-shell' (legacy)
devShells = forAllSystems (systems:
let pkgs = nixpkgs.legacyPackages.${systems};
in import ./shell.nix { inherit pkgs; }
);
};
}
8 changes: 8 additions & 0 deletions nixpkgs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# A nixpkgs instance that is grabbed from the pinned nixpkgs commit in the lock file
# Useful to avoid using channels when using legacy nix commands
let lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked;
in
import (fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz";
sha256 = lock.narHash;
})
16 changes: 16 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Shell for bootstrapping flake-enabled nix and home-manager
# Enter it through 'nix develop' or (legacy) 'nix-shell'

{ pkgs ? (import ./nixpkgs.nix) { } }: {
default = pkgs.mkShell {
# Enable experimental features without having to specify the argument
NIX_CONFIG = "experimental-features = nix-command flakes";
buildInputs = with pkgs; [
gnumake
nixpkgs-fmt
nixd
bun
nodejs_20
];
};
}
2 changes: 1 addition & 1 deletion src/components/universal/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function Footer() {
<IconButton
as='a'
icon={BsGithub}
href='https://github.com/rain-cafe-xiv/silvy'
href='https://github.com/ribbon-studios/silvy'
target="_blank"
rel="noopener noreferrer"
/>
Expand Down

0 comments on commit 81bc443

Please sign in to comment.