Skip to content

Commit

Permalink
style: ci yaml spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
LuanRoger committed Oct 24, 2024
1 parent b059736 commit 11d73dc
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 117 deletions.
114 changes: 53 additions & 61 deletions .github/workflows/vercel_deploy_preview.yaml
Original file line number Diff line number Diff line change
@@ -1,67 +1,59 @@
name: Vercel Deploy Preview

on:
workflow_dispatch:
repository_dispatch:
types: [deploy-preview]
workflow_dispatch:
repository_dispatch:
types: [deploy-preview]

jobs:
deploy:
runs-on: ubuntu-latest
environment: preview
steps:
- uses: actions/checkout@v4
with:
repository: LR-Tech-Blog/content
path: content
- uses: actions/checkout@v4
with:
repository: LR-Tech-Blog/blog
path: blog
- name: Remove dumy post images
run: rm -rf ./blog/public/images/posts
- name: Remove dumy content
run: rm -rf ./blog/src/data
jobs:
deploy:
runs-on: ubuntu-latest
environment: preview
steps:
- uses: actions/checkout@v4
with:
repository: LR-Tech-Blog/content
path: content
- uses: actions/checkout@v4
with:
repository: LR-Tech-Blog/blog
path: blog
- name: Remove dumy post images
run: rm -rf ./blog/public/images/posts
- name: Remove dumy content
run: rm -rf ./blog/src/data

- name: Copy content
run:
|
mkdir ./blog/src/data
mv ./content/data/* ./blog/src/data/
- name: Copy post images
run:
|
mkdir ./blog/public/images/posts
mv ./content/public/images/posts/* ./blog/public/images/posts/

- name: Install Vercel CLI
run: npm install -g vercel
- name: Install dependencies
run:
|
cd ./blog
npm install
- name: Astro build
run:
|
cd ./blog
npx astro sync
npx astro build
- name: Pull env information
run:
|
cd ./blog
vercel pull --yes --environment ${{ vars.VERCEL_ENVIRONMENT }} --token ${{ secrets.VERCEL_TOKEN }}
- name: Vercel build
run:
|
cd ./blog
vercel build --yes --token=${{ secrets.VERCEL_TOKEN }}
- name: Vercel Deploy
run:
|
cd ./blog
vercel deploy --prebuilt --yes --token=${{ secrets.VERCEL_TOKEN }} > ./url.txt
- name: Get Deploy URL
run: echo "::notice name=URL::$(cat ./blog/url.txt)"
- name: Copy content
run: |
mkdir ./blog/src/data
mv ./content/data/* ./blog/src/data/
- name: Copy post images
run: |
mkdir ./blog/public/images/posts
mv ./content/public/images/posts/* ./blog/public/images/posts/
- name: Install Vercel CLI
run: npm install -g vercel
- name: Install dependencies
run: |
cd ./blog
npm install
- name: Astro build
run: |
cd ./blog
npx astro sync
npx astro build
- name: Pull env information
run: |
cd ./blog
vercel pull --yes --environment ${{ vars.VERCEL_ENVIRONMENT }} --token ${{ secrets.VERCEL_TOKEN }}
- name: Vercel build
run: |
cd ./blog
vercel build --yes --token=${{ secrets.VERCEL_TOKEN }}
- name: Vercel Deploy
run: |
cd ./blog
vercel deploy --prebuilt --yes --token=${{ secrets.VERCEL_TOKEN }} > ./url.txt
- name: Get Deploy URL
run: echo "::notice name=URL::$(cat ./blog/url.txt)"
104 changes: 48 additions & 56 deletions .github/workflows/vercel_deploy_production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,53 @@ name: Vercel Deploy Production
on:
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
with:
repository: LR-Tech-Blog/content
path: content
- uses: actions/checkout@v4
with:
repository: LR-Tech-Blog/blog
path: blog
- name: Remove dumy post images
run: rm -rf ./blog/public/images/posts
- name: Remove dumy content
run: rm -rf ./blog/src/data
jobs:
deploy:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
with:
repository: LR-Tech-Blog/content
path: content
- uses: actions/checkout@v4
with:
repository: LR-Tech-Blog/blog
path: blog
- name: Remove dumy post images
run: rm -rf ./blog/public/images/posts
- name: Remove dumy content
run: rm -rf ./blog/src/data

- name: Copy content
run:
|
mkdir ./blog/src/data
mv ./content/data/* ./blog/src/data/
- name: Copy post images
run:
|
mkdir ./blog/public/images/posts
mv ./content/public/images/posts/* ./blog/public/images/posts/

- name: Install Vercel CLI
run: npm install -g vercel
- name: Install dependencies
run:
|
cd ./blog
npm install
- name: Astro build
run:
|
cd ./blog
npx astro sync
npx astro build
- name: Pull env information
run:
|
cd ./blog
vercel pull --yes --environment=${{ vars.VERCEL_ENVIRONMENT }} --token=${{ secrets.VERCEL_TOKEN }}
- name: Vercel build
run:
|
cd ./blog
vercel build --prod --yes --token=${{ secrets.VERCEL_TOKEN }}
- name: Vercel Deploy
run:
|
cd ./blog
vercel deploy --prebuilt --prod --yes --token=${{ secrets.VERCEL_TOKEN }}
- name: Copy content
run: |
mkdir ./blog/src/data
mv ./content/data/* ./blog/src/data/
- name: Copy post images
run: |
mkdir ./blog/public/images/posts
mv ./content/public/images/posts/* ./blog/public/images/posts/
- name: Install Vercel CLI
run: npm install -g vercel
- name: Install dependencies
run: |
cd ./blog
npm install
- name: Astro build
run: |
cd ./blog
npx astro sync
npx astro build
- name: Pull env information
run: |
cd ./blog
vercel pull --yes --environment=${{ vars.VERCEL_ENVIRONMENT }} --token=${{ secrets.VERCEL_TOKEN }}
- name: Vercel build
run: |
cd ./blog
vercel build --prod --yes --token=${{ secrets.VERCEL_TOKEN }}
- name: Vercel Deploy
run: |
cd ./blog
vercel deploy --prebuilt --prod --yes --token=${{ secrets.VERCEL_TOKEN }}

0 comments on commit 11d73dc

Please sign in to comment.