-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a33a9a5
commit ce5599e
Showing
17 changed files
with
134 additions
and
999 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Deploy Site | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
- main | ||
|
||
jobs: | ||
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 | ||
with: | ||
node-version: '20.12.1' | ||
|
||
- name: Public IP | ||
id: ip | ||
uses: candidob/get-runner-ip@v1.0.0 | ||
|
||
- name: Setup Linode Cloud Firewall | ||
uses: linode/action-linode-cli@v1 | ||
with: | ||
token: "${{ secrets.LINODE_CLI_TOKEN }}" | ||
|
||
- name: build dev | ||
id: build | ||
env: | ||
dev-url: '${{secrets.DEVURL}}' | ||
blog-url: '${{secrets.BLOGURL}}' | ||
run: | | ||
sed -i -e 's#${{env.blog-url}}#'${{ env.dev-url }}'#g' ./src/config.yml | ||
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: | | ||
bash ./.github/linode.sh -a --verbose | ||
- name: deploy blog | ||
uses: burnett01/rsync-deployments@5.2.1 | ||
id: deploy | ||
with: | ||
switches: -avr | ||
path: ./dist/ | ||
remote_path: /opt/sites/astro-blog-test/ | ||
remote_host: ${{ secrets.LINODEHOST }} | ||
remote_port: 22 | ||
remote_user: ${{ secrets.LINODEUSER }} | ||
remote_key: ${{ secrets.LINODESSHKEY }} | ||
|
||
- name: Close Linode Cloud Firewall for GH | ||
if: (steps.deploy.outcome == 'success') || (steps.deploy.outcome == 'failed' || steps.deploy.outcome == 'skipped') | ||
id: linode-fw-close | ||
run: | | ||
bash ./.github/linode.sh -d --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#/bin/bash | ||
|
||
while getopts ":a:d" option; do | ||
case $option in | ||
a) | ||
linode-cli firewalls rules-update $LINODE_FW_ID \ | ||
--inbound '[{"action":"ACCEPT", "protocol": "TCP", "ports": "22", "addresses": {"ipv4": ["'$HOME_IP'", "'$PUB_IP'"]}, "label": "accept-inbound-SSH"}, {"action":"ACCEPT", "protocol": "TCP", "ports": "80", "addresses": {"ipv4": ["0.0.0.0/0"], "ipv6": ["::/0"]}, "label": "accept-inbound-HTTP"}, {"action":"ACCEPT", "protocol": "TCP", "ports": "443", "addresses": {"ipv4": ["0.0.0.0/0"], "ipv6": ["::/0"]}, "label": "accept-inbound-HTTPS"}]' | ||
;; | ||
d) | ||
linode-cli firewalls rules-update $LINODE_FW_ID \ | ||
--inbound '[{"action":"ACCEPT", "protocol": "TCP", "ports": "22", "addresses": {"ipv4": ["'$HOME_IP'"]}, "label": "accept-inbound-SSH"}, {"action":"ACCEPT", "protocol": "TCP", "ports": "80", "addresses": {"ipv4": ["0.0.0.0/0"], "ipv6": ["::/0"]}, "label": "accept-inbound-HTTP"}, {"action":"ACCEPT", "protocol": "TCP", "ports": "443", "addresses": {"ipv4": ["0.0.0.0/0"], "ipv6": ["::/0"]}, "label": "accept-inbound-HTTPS"}]' | ||
;; | ||
esac | ||
done |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 0 additions & 51 deletions
51
src/content/post/get-started-website-with-astro-tailwind-css.md
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.