summaryrefslogtreecommitdiff
path: root/.github/workflows/production.yaml
diff options
context:
space:
mode:
authorCraig Jennings <craigmartinjennings@gmail.com>2024-03-24 14:41:32 -0500
committerCraig Jennings <craigmartinjennings@gmail.com>2024-03-24 14:41:32 -0500
commit4aed6ea63ae93704b5d4cc07b528a0dd70a5d752 (patch)
treed7610e41ff54da3f340cec1c86134c189a44db8a /.github/workflows/production.yaml
initial commit; forked from https://github.com/Yukuro/hugo-theme-shell
Diffstat (limited to '.github/workflows/production.yaml')
-rw-r--r--.github/workflows/production.yaml57
1 files changed, 57 insertions, 0 deletions
diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml
new file mode 100644
index 0000000..67efd41
--- /dev/null
+++ b/.github/workflows/production.yaml
@@ -0,0 +1,57 @@
+name: production
+env:
+ VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
+ VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
+on:
+ push:
+ branches:
+ - master
+
+jobs:
+ deploy-production:
+ runs-on: ubuntu-latest
+ concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ steps:
+ - name: Setup Hugo
+ uses: peaceiris/actions-hugo@v2
+ with:
+ hugo-version: 'latest'
+ extended: true
+
+ - name: Setup Go
+ uses: actions/setup-go@v4.0.0
+ with:
+ go-version: '^1.21'
+
+ - name: Install Vercel CLI
+ run: npm install --global vercel@latest
+
+ - name: SetUp Env
+ run: hugo new site testenv
+
+ - name: Set theme
+ uses: actions/checkout@v3
+ with:
+ path: ./testenv/themes/hugo-theme-shell
+
+ - name: Build
+ run: hugo --minify -t hugo-theme-shell
+ working-directory: ./testenv
+
+ - name: Pull Vercel Environment Information
+ run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} --cwd ./testenv
+
+ - name: Build Project Artifacts
+ run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} --cwd ./testenv
+
+ - name: Deploy Project Artifacts to Vercel
+ if: ${{ github.ref == 'refs/heads/master' }}
+ run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} --cwd ./testenv
+
+ - name: Deploy
+ uses: peaceiris/actions-gh-pages@v3
+ if: ${{ github.ref == 'refs/heads/master' }}
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: ./testenv/public