chore: remove staging environment configuration file #1
This file contains hidden or 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
name: Deploy to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment per environment | |
concurrency: | |
group: "pages-${{ github.ref_name }}" | |
cancel-in-progress: false | |
jobs: | |
# Build job | |
build: | |
runs-on: ubuntu-latest | |
env: | |
HUGO_VERSION: 0.128.0 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v3 | |
with: | |
hugo-version: '${{ env.HUGO_VERSION }}' | |
extended: true | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Load environment variables (Production) | |
run: | | |
if [ -f config/deploy-prod.env ]; then | |
echo "Loading production environment..." | |
export $(grep -v '^#' config/deploy-prod.env | xargs) | |
echo "BASE_URL=${BASE_URL}" >> $GITHUB_ENV | |
echo "HUGO_ENVIRONMENT=${HUGO_ENVIRONMENT}" >> $GITHUB_ENV | |
fi | |
- name: Generate CDN Headers | |
run: npm run headers | |
- name: Build with Hugo (Production) | |
run: | | |
hugo \ | |
--minify \ | |
--baseURL "${{ env.BASE_URL }}" \ | |
--environment "${{ env.HUGO_ENVIRONMENT }}" | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./public | |
name: "production" | |
# Deployment job for Production | |
deploy: | |
environment: | |
name: production | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
with: | |
artifact_name: production |