Skip to content

Commit aa8ebab

Browse files
Fraccamanjurevans
andauthored
ci: add faucet docker build (#2285)
Co-authored-by: Justin R. Evans <jurevans@gmail.com>
1 parent 7ce5299 commit aa8ebab

File tree

9 files changed

+89
-88
lines changed

9 files changed

+89
-88
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Docker Faucet 🐳
2+
3+
on:
4+
push:
5+
tags:
6+
- faucet@v*
7+
branches:
8+
- main
9+
pull_request:
10+
branches:
11+
- main
12+
paths:
13+
- 'docker/faucet/**'
14+
- '.github/workflows/docker-faucet.yml'
15+
- apps/faucet/**
16+
17+
env:
18+
GIT_LFS_SKIP_SMUDGE: 1
19+
20+
permissions:
21+
id-token: write
22+
contents: write
23+
packages: write
24+
25+
jobs:
26+
docker:
27+
runs-on: ubuntu-latest
28+
strategy:
29+
fail-fast: true
30+
matrix:
31+
images:
32+
- path: "docker/faucet/Dockerfile"
33+
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v4
37+
38+
- name: Set up QEMU
39+
uses: docker/setup-qemu-action@v3
40+
41+
- name: Set up Docker Buildx
42+
uses: docker/setup-buildx-action@v3
43+
44+
- name: Login to GHCR
45+
uses: docker/login-action@v3
46+
with:
47+
registry: ghcr.io
48+
username: ${{ github.repository_owner }}
49+
password: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Determine Image Tag
52+
id: tag
53+
run: |
54+
if [[ "${GITHUB_REF}" == refs/tags/faucet@v* ]]; then
55+
echo "IMAGE_TAG=faucet-${GITHUB_REF#refs/tags/faucet@}" >> $GITHUB_ENV
56+
else
57+
echo "IMAGE_TAG=faucet-main" >> $GITHUB_ENV
58+
fi
59+
60+
- name: Docker meta
61+
id: meta
62+
uses: docker/metadata-action@v4
63+
with:
64+
images: ghcr.io/${{ github.repository_owner }}/faucet
65+
tags: |
66+
type=raw,value=${{ env.IMAGE_TAG }}
67+
68+
- name: Build and Push Docker Image
69+
uses: docker/build-push-action@v6
70+
with:
71+
context: .
72+
file: ${{ matrix.images.path }}
73+
push: ${{ github.event_name == 'push' }}
74+
tags: ${{ steps.meta.outputs.tags }}
75+
labels: ${{ steps.meta.outputs.labels }}
76+
cache-from: type=gha
77+
cache-to: type=gha,mode=max

.github/workflows/release-faucet.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

apps/faucet/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"react": "^18.3.0",
2525
"react-dom": "^18.3.0",
2626
"react-router-dom": "^6.0.0",
27-
"styled-components": "^6.1.18"
27+
"styled-components": "^6.1.19"
2828
},
2929
"devDependencies": {
3030
"@babel/plugin-transform-modules-commonjs": "^7.20.11",

apps/faucet/src/App/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { createContext, useEffect, useState } from "react";
1+
import { createContext, useEffect, useState } from "react";
22
import { GoGear } from "react-icons/go";
33
import { ThemeProvider } from "styled-components";
44

@@ -78,7 +78,7 @@ const START_TIME_TEXT = new Date(START_TIME_UTC * 1000).toLocaleString(
7878

7979
export const AppContext = createContext<AppContext | null>(null);
8080

81-
export const App: React.FC = () => {
81+
export const App = (): JSX.Element => {
8282
const initialColorMode = "dark";
8383

8484
const [colorMode, _] = useState<ColorMode>(initialColorMode);

apps/faucet/src/App/Common/Faq.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { Text } from "@namada/components";
2-
import React from "react";
32
import { FaqContainer, FaqUrl } from "./Faq.components";
43
import { FaqDropdown } from "./FaqDropdown";
54

65
const namadaDiscord = "https://discord.com/invite/namada";
76
const becomeValidatorUrl =
87
"https://docs.namada.net/operators/validators/post-genesis-validator-setup";
98

10-
export const Faq: React.FC = () => {
9+
export const Faq = (): JSX.Element => {
1110
return (
1211
<FaqContainer>
1312
<Text className="text-black text-5xl my-0">FAQs</Text>

apps/faucet/src/App/Common/FaqDropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type Props = {
1212
title: string;
1313
children: React.ReactNode;
1414
};
15-
export const FaqDropdown: React.FC<Props> = ({ children, title }) => {
15+
export const FaqDropdown = ({ children, title }: Props): JSX.Element => {
1616
const [isOpen, setIsOpen] = useState<boolean | null>(null);
1717

1818
const handleToggle = (): void => {

docker/faucet/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
FROM rust:1.85.1 AS builder
1+
FROM ubuntu:24.04 AS builder
22
WORKDIR /app
33

4-
RUN apt update && apt install -y nodejs npm clang pkg-config libssl-dev protobuf-compiler curl
4+
RUN apt update && apt install -y nodejs npm
55
RUN npm install -g yarn
66

77
COPY .yarnrc.yml tsconfig.base.json package.json yarn.lock .
88
COPY ./.yarn ./.yarn
99
COPY ./packages ./packages
10-
COPY ./scripts ./scripts
1110
COPY ./apps/faucet/package.json ./apps/faucet/package.json
1211

1312
RUN yarn

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3766,7 +3766,7 @@ __metadata:
37663766
react-dom: "npm:^18.3.0"
37673767
react-router-dom: "npm:^6.0.0"
37683768
style-loader: "npm:^4.0.0"
3769-
styled-components: "npm:^6.1.18"
3769+
styled-components: "npm:^6.1.19"
37703770
tailwindcss: "npm:^3.4.1"
37713771
ts-loader: "npm:^9.3.1"
37723772
ts-node: "npm:^10.9.1"
@@ -19507,9 +19507,9 @@ __metadata:
1950719507
languageName: node
1950819508
linkType: hard
1950919509

19510-
"styled-components@npm:^6.1.18":
19511-
version: 6.1.18
19512-
resolution: "styled-components@npm:6.1.18"
19510+
"styled-components@npm:^6.1.19":
19511+
version: 6.1.19
19512+
resolution: "styled-components@npm:6.1.19"
1951319513
dependencies:
1951419514
"@emotion/is-prop-valid": "npm:1.2.2"
1951519515
"@emotion/unitless": "npm:0.8.1"
@@ -19523,7 +19523,7 @@ __metadata:
1952319523
peerDependencies:
1952419524
react: ">= 16.8.0"
1952519525
react-dom: ">= 16.8.0"
19526-
checksum: 10c0/067778b8cf9aa24b23590d23210b0e7964c6469630e5ab821c68dac64af6e0c0270c972a836f60a8bbd9753770f0475f911fcd34eeba6bd003c233a79a391e6b
19526+
checksum: 10c0/8d20427a5debe54bfa3b55f79af2a3577551ed7f1d1cd34df986b73fd01ac519f9081b7737cc1f76e12fbc483fa50551e55be0bc984296e623cc6a2364697cd8
1952719527
languageName: node
1952819528
linkType: hard
1952919529

0 commit comments

Comments
 (0)