Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions Dockerfile

This file was deleted.

66 changes: 31 additions & 35 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
#!/usr/bin/env groovy
library '[email protected]'

pipeline {
agent { label 'linux' }

parameters {
string(
name: 'IMAGE_TAG',
defaultValue: params.IMAGE_TAG ?: '',
description: 'Optional Docker image tag to push.'
)
}

options {
disableConcurrentBuilds()
/* manage how many builds we keep */
Expand All @@ -19,49 +14,50 @@ pipeline {
}

environment {
IMAGE_NAME = 'statusteam/free-technology'
NEXT_PUBLIC_SITE_URL = "https://${env.JOB_BASE_NAME}"
GIT_COMMITTER_NAME = 'status-im-auto'
GIT_COMMITTER_EMAIL = '[email protected]'
}

stages {
stage('Build') {
steps {
stage('Install') {
steps {
script {
withCredentials([
string(
credentialsId: 'free-technology-github-token',
variable: 'NEXT_GITHUB_PERSONAL_ACCESS_TOKEN'
),
]) {
image = docker.build(
"${IMAGE_NAME}:${GIT_COMMIT.take(8)}",
["--build-arg='NEXT_GITHUB_PERSONAL_ACCESS_TOKEN=${NEXT_GITHUB_PERSONAL_ACCESS_TOKEN}'",
"."].join(' ')
)
}
nix.develop('yarn install')
}
}
}

stage('Push') {
steps { script {
withDockerRegistry([credentialsId: 'dockerhub-statusteam-auto', url: '']) {
image.push()
stage('Build') {
steps {
script {
nix.develop('yarn build')
jenkins.genBuildMetaJSON('build/build.json')
}
} }
}
}

stage('Deploy') {
when { expression { params.IMAGE_TAG != '' } }
steps { script {
withDockerRegistry([credentialsId: 'dockerhub-statusteam-auto', url: '']) {
image.push(params.IMAGE_TAG)
stage('Publish') {
steps {
sshagent(credentials: ['status-im-auto-ssh']) {
script {
nix.develop("""
ghp-import \
-b ${deployBranch()} \
-c ${deployDomain()} \
-p build
"""
)
}
}
} }
}
}
}

post {
cleanup { cleanWs() }
}
}

def isMasterBranch() { GIT_BRANCH ==~ /.*master/ }
def deployBranch() { isMasterBranch() ? 'deploy-master' : 'deploy-develop' }
def deployDomain() { isMasterBranch() ? 'free.technology' : 'dev.free.technology' }
26 changes: 26 additions & 0 deletions flake.lock

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

31 changes: 31 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-24.05";
};

outputs =
{ self, nixpkgs }:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forEachSystem = nixpkgs.lib.genAttrs supportedSystems;
pkgsFor = forEachSystem (system: import nixpkgs { inherit system; });
in
rec {
formatter = forEachSystem (system: pkgsFor.${system}.nixpkgs-fmt);

devShells = forEachSystem (system: {
default = pkgsFor.${system}.mkShellNoCC {
packages = with pkgsFor.${system}.buildPackages; [
yarn # 1.22.22
nodejs_20 # v20.15.1
ghp-import # 2.1.0
];
};
});
};
}
6 changes: 5 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ const withMDX = createMDX({

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
output: 'export',
trailingSlash: true,
images: {
unoptimized: true,
},
pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],
images: {
domains: ['avatars.githubusercontent.com'],
Expand Down