feat: Enhance website deployment and build process
- Added rsync installation in setup-env action for file synchronization. - Excluded playbook_websites.yml from ansible-apply-playbook workflow. - Created a new workflow for building and releasing the Hugo website. - Added submodule for Hugo theme in .gitmodules. - Updated host_vars for production to include websites configuration. - Introduced playbook_websites.yml for managing static files deployment. - Implemented hugo_build script for building and archiving Hugo sites. - Updated inventory to include a new web group for website deployment. - Refactored Terraform configuration to support new website structure. - Removed deprecated WordPress Terraform configuration. - Added .gitignore files for websites and specific Hugo site. - Created archetype and configuration files for the Hugo site. - Added static assets including CV and images for the Hugo site. - Integrated Hugo profile theme as a submodule for the website.
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
name: Build and Release Hugo Website
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'ansible/playbook_websites.yml'
|
||||
- 'websites/**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Hugo Website
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2
|
||||
with:
|
||||
hugo-version: 'latest'
|
||||
|
||||
- name: Setup environment
|
||||
id: setup_env
|
||||
uses: ./.github/actions/setup-env
|
||||
|
||||
- name: Setup Ansible environment
|
||||
uses: ./.github/actions/setup-ansible-env
|
||||
with:
|
||||
project-id: ${{ secrets.BW_PROJECT_ID }}
|
||||
organization-id: ${{ secrets.BW_ORGANIZATION_ID }}
|
||||
access-token: ${{ secrets.BW_ACCESS_TOKEN }}
|
||||
ansible-user: ${{ secrets.ANSIBLE_USER }}
|
||||
trusted-hosts: ${{ secrets.TRUSTED_HOSTS }}
|
||||
|
||||
- name: Run hugo_build command
|
||||
run: bin/hugo_build.sh
|
||||
|
||||
- name: Run the playbook to deploy websites
|
||||
env:
|
||||
BW_PROJECT_ID: ${{ secrets.BW_PROJECT_ID }}
|
||||
BW_ORGANIZATION_ID: ${{ secrets.BW_ORGANIZATION_ID }}
|
||||
BW_ACCESS_TOKEN: ${{ secrets.BW_ACCESS_TOKEN }}
|
||||
ANSIBLE_USER: ${{ secrets.ANSIBLE_USER }}
|
||||
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
|
||||
CHANGED_FILES: ${{ steps.setup_env.outputs.CHANGED_FILES }}
|
||||
run: |
|
||||
cd ansible
|
||||
sectool -f ../sectool.json exec ansible-playbook -u $ANSIBLE_USER playbook_websites.yml
|
||||
Reference in New Issue
Block a user