Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site v1 #1

Merged
merged 10 commits into from
Jun 6, 2024
Merged
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
152 changes: 152 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
name: Deploy Site

on:
push:
branches:
- dev
- main

jobs:
prod:
if: github.ref =='refs/heads/main' && !contains(github.event.head_commit.message, '!noci')
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4

- name: setup node
uses: actions/setup-node@v4
with:
node-version: '20.12.1'
cache: 'npm'

- name: Public IP
id: ip
uses: candidob/[email protected]

- name: Setup Linode Cloud Firewall
uses: linode/action-linode-cli@v1
with:
token: "${{ secrets.LINODE_CLI_TOKEN }}"

- name: build dev
id: build
run: |
sed -i -e 's#{GA-ID}#'${{ secrets.GOOGLE_ANALYTICS_ID }}'#g' ./src/layouts/DefaultLayout.astro
npm install
npm run build

- name: test production site
uses: chabad360/htmlproofer@master
id: testing
with:
directory: "./dist/"
arguments: --disable-external --checks --allow-hash-href --ignore_urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"

- name: Setup SSH
id: ssh-setup
run: |
mkdir ~/.ssh
touch ~/.ssh/known_hosts
echo ${{ secrets.LINODEFINGERPRINT }} >> ~/.ssh/known_hosts

- name: Open Linode Cloud Firewall for GH
if: (steps.ssh-setup.outcome == 'success')
id: linode-fw-open
env:
PUB_IP: "${{ steps.ip.outputs.ipv4 }}/32"
HOME_IP: "${{ secrets.HOMEIP }}"
LINODE_FW_ID: "${{ secrets.LINODE_FW_ID }}"
run: |
wget https://raw.githubusercontent.com/alexandzors/utils/main/linode-scripts/linode.sh
bash ./linode.sh -a --verbose

- name: deploy blog
uses: burnett01/[email protected]
id: deploy
with:
switches: -avr
path: ./dist/
remote_path: /opt/sites/agnet/
remote_host: ${{ secrets.LINODEHOST }}
remote_port: 22
remote_user: ${{ secrets.LINODEUSER }}
remote_key: ${{ secrets.LINODESSHKEY }}

- name: Close Linode Cloud Firewall for GH
if: always()
id: linode-fw-close
run: |
bash ./linode.sh -d --verbose

dev:
if: github.ref =='refs/heads/dev' && !contains(github.event.head_commit.message, '!noci')
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4

- name: setup node
uses: actions/setup-node@v4
with:
node-version: '20.12.1'
cache: 'npm'

- name: Public IP
id: ip
uses: candidob/[email protected]

- name: Setup Linode Cloud Firewall
uses: linode/action-linode-cli@v1
with:
token: "${{ secrets.LINODE_CLI_TOKEN }}"

- name: build dev
id: build
run: |
sed -i -e 's#{GA-ID}#'${{ secrets.GOOGLE_ANALYTICS_ID_DEV }}'#g' ./src/layouts/DefaultLayout.astro
npm install
npm run build

- name: test production site
uses: chabad360/htmlproofer@master
id: testing
with:
directory: "./dist/"
arguments: --disable-external --checks --allow-hash-href --ignore_urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"

- name: Setup SSH
id: ssh-setup
run: |
mkdir ~/.ssh
touch ~/.ssh/known_hosts
echo ${{ secrets.LINODEFINGERPRINT }} >> ~/.ssh/known_hosts

- name: Open Linode Cloud Firewall for GH
if: (steps.ssh-setup.outcome == 'success')
id: linode-fw-open
env:
PUB_IP: "${{ steps.ip.outputs.ipv4 }}/32"
HOME_IP: "${{ secrets.HOMEIP }}"
LINODE_FW_ID: "${{ secrets.LINODE_FW_ID }}"
run: |
wget https://raw.githubusercontent.com/alexandzors/utils/main/linode-scripts/linode.sh
bash ./linode.sh -a --verbose

- name: deploy blog
uses: burnett01/[email protected]
id: deploy
with:
switches: -avr
path: ./dist/
remote_path: /opt/sites/agnet-dev/
remote_host: ${{ secrets.LINODEHOST }}
remote_port: 22
remote_user: ${{ secrets.LINODEUSER }}
remote_key: ${{ secrets.LINODESSHKEY }}

- name: Close Linode Cloud Firewall for GH
if: always()
id: linode-fw-close
run: |
bash ./linode.sh -d --verbose
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,3 @@ yarn-error.log*

# webstorm settings and dictionaries
.idea

# package lock
package-lock.json
4 changes: 4 additions & 0 deletions BRANDING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Branding information for Alex's Guardian

## Color Palette

18 changes: 15 additions & 3 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,23 @@ import mdx from '@astrojs/mdx'
import tailwind from '@astrojs/tailwind'
import compress from 'astro-compress'
import icon from "astro-icon"
import partytown from "@astrojs/partytown";

// https://astro.build/config
export default defineConfig({
compressHTML: true,
integrations: [mdx(), icon(), tailwind({
applyBaseStyles: false,
}), compress()],
integrations: [
mdx(),
icon(),
tailwind({
applyBaseStyles: false,
}),
compress(),
partytown({
// Adds dataLayer.push as a forwarding-event.
config: {
forward: ["dataLayer.push"],
},
}),
],
})
Loading