3 Commits

Author SHA1 Message Date
4521ca2090 Specify python version 2022-05-14 08:14:38 +01:00
74e49ddde7 Add build requirements for node-gyp 2022-05-14 08:12:20 +01:00
f42e10156e Change base to use alpine 2022-05-14 08:09:01 +01:00
9 changed files with 532 additions and 1040 deletions

View File

@@ -1,96 +1,88 @@
name: Docker Build name: Docker Build
on: on:
push: push:
branches: branches:
- main # Set a branch to deploy - main
env:
env: IMAGE_REGISTRY: ghcr.io
IMAGE_REGISTRY: ghcr.io TOKEN_USER: HotaruBlaze
IMAGE_OWNER: fluttershub IMAGE_OWNER: fluttershub
IMAGE_NAME: homepage IMAGE_NAME: homepage
jobs: jobs:
Build_x86: BuildImage:
runs-on: ubuntu-latest runs-on: ubuntu-latest
# If running with act, Uncomment below strategy:
# container: phaze9/action-runner matrix:
env: CPU_ARCH:
DOCKER_CONFIG: $HOME/.docker - arm64
steps: - x86_64
- uses: actions/checkout@v2 # If running with act, Uncomment below
# container: phaze9/action-runner
- name: Set up Docker Buildx env:
id: buildx DOCKER_CONFIG: $HOME/.docker
uses: docker/setup-buildx-action@v1 steps:
- uses: actions/checkout@v2
- name: Login to ghcr.io
uses: docker/login-action@v1 - name: Set up QEMU
with: uses: docker/setup-qemu-action@v1
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.IMAGE_OWNER }} - name: Set up Docker Buildx
password: ${{ secrets.GITHUB_TOKEN }} id: buildx
uses: docker/setup-buildx-action@v1
- name: Build Docker Image
id: docker_build_x64 - name: Available platforms
uses: docker/build-push-action@v2 run: echo ${{ steps.buildx.outputs.platforms }}
with:
push: true - name: Login to ghcr.io
platforms: linux/amd64 uses: docker/login-action@v1
labels: org.opencontainers.image.source https://github.com/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }} with:
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:x64-latest registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.TOKEN_USER }}
Build_ARM64: password: ${{ secrets.TOKEN }}
runs-on: [self-hosted, linux, ARM64]
# If running with act, Uncomment below - name: Build and push - x64
# container: phaze9/action-runner id: docker_build_x64
env: uses: docker/build-push-action@v2
DOCKER_CONFIG: $HOME/.docker if: ${{ matrix.CPU_ARCH == 'x86_64'}}
steps: with:
- uses: actions/checkout@v2 push: true
platforms: linux/amd64
- name: Set up Docker Buildx labels: org.opencontainers.image.source https://github.com/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}
id: buildx tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:x64-latest
uses: docker/setup-buildx-action@v1
- name: Build and push - arm64
- name: Login to ghcr.io id: docker_build_arm64
uses: docker/login-action@v1 uses: docker/build-push-action@v2
with: if: ${{ matrix.CPU_ARCH == 'arm64'}}
registry: ${{ env.IMAGE_REGISTRY }} with:
username: ${{ env.IMAGE_OWNER }} push: true
password: ${{ secrets.GITHUB_TOKEN }} platforms: linux/arm64
labels: org.opencontainers.image.source https://github.com/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}
- name: Build Docker Image tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:arm-latest
id: docker_build_arm64
uses: docker/build-push-action@v2 Deploy:
with: runs-on: ubuntu-latest
push: true needs: BuildImage
platforms: linux/arm64 steps:
labels: org.opencontainers.image.source https://github.com/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }} - uses: actions/checkout@v2
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:arm64-latest - name: Run Ansible playbook
# uses: dawidd6/action-ansible-playbook@v2.5.0
uses: dawidd6/action-ansible-playbook@671974ed60e946e11964cb0c26e69caaa4b1f559
Deploy: with:
runs-on: ubuntu-latest playbook: playbook.yml
needs: Build_x86 directory: ./
steps: key: ${{secrets.DEPLOY_SSH_KEY}}
- uses: actions/checkout@v2 inventory: |
- name: Run Ansible playbook [docker]
# uses: dawidd6/action-ansible-playbook@v2.5.0 fluttershub.com
uses: dawidd6/action-ansible-playbook@671974ed60e946e11964cb0c26e69caaa4b1f559 [docker:vars]
with: ansible_ssh_common_args='-o StrictHostKeyChecking=no'
playbook: playbook.yml ansible_ssh_user=deploy
directory: ./ options: |
key: ${{secrets.DEPLOY_SSH_KEY}} --verbose
inventory: | # Set to "true" if root is required for running your playbook
[docker] # sudo: false # optional
fluttershub.com # Set to "true" if the Ansible output should not include colors (defaults to "false")
[docker:vars] # no_color: # optional
ansible_ssh_common_args='-o StrictHostKeyChecking=no'
ansible_ssh_user=deploy
options: |
--verbose
# Set to "true" if root is required for running your playbook
# sudo: false # optional
# Set to "true" if the Ansible output should not include colors (defaults to "false")
# no_color: # optional

View File

@@ -39,7 +39,7 @@ jobs:
# Snyk can be used to break the build when it detects vulnerabilities. # Snyk can be used to break the build when it detects vulnerabilities.
# In this case we want to upload the issues to GitHub Code Scanning # In this case we want to upload the issues to GitHub Code Scanning
continue-on-error: true continue-on-error: true
uses: snyk/actions/docker@master uses: snyk/actions/docker@14818c4695ecc4045f33c9cee9e795a788711ca4
env: env:
# In order to use the Snyk Action you will need to have a Snyk API token. # In order to use the Snyk Action you will need to have a Snyk API token.
# More details in https://github.com/snyk/actions#getting-your-snyk-token # More details in https://github.com/snyk/actions#getting-your-snyk-token

View File

@@ -1,23 +1,20 @@
FROM node:18.6 AS base FROM node:18-alpine AS base
LABEL version="4.1.0" LABEL version="4.1.0"
LABEL description="" LABEL description=""
RUN apt-get update && apt-get upgrade -y \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/app WORKDIR /usr/src/app
COPY ["package.json", "./"] COPY ["package.json", "./"]
COPY ["yarn.lock", "./"] COPY ["yarn.lock", "./"]
FROM base AS builder FROM base AS builder
RUN yarn install RUN apk add --no-cache --virtual .gyp python3 make g++ \
&& yarn install \
&& apk del .gyp
COPY ["src/", "./src"] COPY ["src/", "./src"]
RUN npm run Prod RUN npm run Prod
FROM nginx:1.23.1-alpine as Web FROM nginx:1.21.6-alpine as Web
RUN apk --update --no-cache upgrade
LABEL maintainer="Phoenix (https://github.com/HotaruBlaze)" LABEL maintainer="Phoenix (https://github.com/HotaruBlaze)"
COPY docker/nginx.conf /etc/nginx/nginx.conf COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY docker/web.conf /etc/nginx/conf.d/web.conf COPY docker/web.conf /etc/nginx/conf.d/web.conf

View File

@@ -7,7 +7,7 @@
"author": "HotaruBlaze", "author": "HotaruBlaze",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git@github.com:Fluttershub/Homepage.git" "url": "git@github.com:github/Fluttershub.git"
}, },
"scripts": { "scripts": {
"preinit": "npx npm-force-resolutions", "preinit": "npx npm-force-resolutions",
@@ -17,9 +17,10 @@
"Prod": "npm run Cleanup && npm run Init && parcel build src/index.pug --dist-dir build" "Prod": "npm run Cleanup && npm run Init && parcel build src/index.pug --dist-dir build"
}, },
"devDependencies": { "devDependencies": {
"@parcel/transformer-pug": "2.6.2", "parcel": "^2.5.0"
"@parcel/transformer-sass": "2.6.2", },
"parcel": "^2.6.2" "engines": {
"node": "^18.*"
}, },
"resolutions": { "resolutions": {
"node-forge": "0.10.0" "node-forge": "0.10.0"

View File

@@ -18,6 +18,7 @@
mode: '0755' mode: '0755'
loop: loop:
- docker-compose.yml - docker-compose.yml
register: compose
- name: deploy Docker Compose stack if updated - name: deploy Docker Compose stack if updated
community.docker.docker_compose: community.docker.docker_compose:
@@ -25,3 +26,4 @@
pull: true pull: true
files: files:
- docker-compose.yml - docker-compose.yml
when: compose.changed

View File

@@ -14,7 +14,7 @@ html(lang='en')
.container .container
.pod .pod
.glow .glow
img#profile_pic(src='https://s3.fluttershub.com/fluttershub-com/public/profile_pic.png', alt='') img#profile_pic(src='https://img.fluttershub.com/VjpiMs7xp60yEcAH.png', alt='')
h1.welcome_text.text-flicker.text-flicker-1 Phoenix/Hotaru h1.welcome_text.text-flicker.text-flicker-1 Phoenix/Hotaru
p.about_me.standard_text.text-box-glow p.about_me.standard_text.text-box-glow
.pod .pod
@@ -22,8 +22,6 @@ html(lang='en')
a.standard_text.text-flicker-2(href="https://twitter.com/HotaruBlaze") Twitter a.standard_text.text-flicker-2(href="https://twitter.com/HotaruBlaze") Twitter
a.standard_text.text-flicker-2(href="https://github.com/HotaruBlaze") Github a.standard_text.text-flicker-2(href="https://github.com/HotaruBlaze") Github
a.standard_text.text-flicker-2(href="https://gitlab.com/HotaruBlaze") Gitlab a.standard_text.text-flicker-2(href="https://gitlab.com/HotaruBlaze") Gitlab
a.standard_text.text-flicker-2(href="mailto:hotarublaze@gmail.com") Email
footer.standard_text.footer-slide footer.standard_text.footer-slide
.creator .creator
a.build_text(href="https://www.youtube.com/watch?v=5DWFZhAVI3s") Cookie? a.build_text(href="https://img.fluttershub.com/EgOwhwrHyHWw.png") Cookie? 🍪
a.cookie(href="https://img.fluttershub.com/pdDK7pdVJZU3d9UI.jpg") 🍪

View File

@@ -2,5 +2,5 @@ meta(property='og:url', content='https://fluttershub.com')
meta(property='og:type', content='website') meta(property='og:type', content='website')
meta(property='og:title', content='Phoenix\'s Personal Website') meta(property='og:title', content='Phoenix\'s Personal Website')
meta(property='og:description', content='We got cookies and milk!') meta(property='og:description', content='We got cookies and milk!')
meta(property='og:image', content='http://s3.fluttershub.com/fluttershub-com/public/profile_pic.png') meta(property='og:image', content='http://storage.googleapis.com/api.fluttershub.com/images/public/profile_pic.jpg')
meta(property='og:image:secure_url', content='https://s3.fluttershub.com/fluttershub-com/public/profile_pic.png') meta(property='og:image:secure_url', content='https://storage.googleapis.com/api.fluttershub.com/images/public/profile_pic.jpg')

View File

@@ -60,9 +60,6 @@ body,html, .container {
-moz-user-select: text; -moz-user-select: text;
text-decoration: none; text-decoration: none;
} }
.cookie {
text-decoration: none !important;
}
.no_hightnight a:link, a{ .no_hightnight a:link, a{
color: inherit; color: inherit;

1347
yarn.lock

File diff suppressed because it is too large Load Diff