Skip to content

blog: update content #26

blog: update content

blog: update content #26

Workflow file for this run

name: CI + CD
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
env:
ARTIFACT_NAME: bayukurnia-com-${{ github.sha }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
token: ${{ secrets.CI_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm run build
env:
SITE_URL: ${{ vars.SITE_URL }}
CLOUDINARY_CLOUD_NAME: ${{ vars.CLOUDINARY_CLOUD_NAME }}
CLOUDINARY_FOLDER: ${{ vars.CLOUDINARY_FOLDER }}
SPOTIFY_CLIENT_ID: ${{ secrets.SPOTIFY_CLIENT_ID }}
SPOTIFY_CLIENT_SECRET: ${{ secrets.SPOTIFY_CLIENT_SECRET }}
SPOTIFY_REFRESH_TOKEN: ${{ secrets.SPOTIFY_REFRESH_TOKEN }}
- uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: |
.git
dist
preview:
name: Deploy to Preview
if: github.event.ref == 'refs/heads/main'
needs: [build]
runs-on: ubuntu-latest
environment:
name: Preview
url: ${{ steps.upload-to-cloudflare.outputs.url }}
steps:
- uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
- name: Upload to Cloudflare Pages
id: upload-to-cloudflare
uses: cloudflare/[email protected]
with:
branch: preview/${{ github.ref_name }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.ACCOUNT_ID }}
projectName: bayukurnia-com
directory: dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
prod:
name: Deploy to Production
needs: [preview]
runs-on: ubuntu-latest
environment:
name: Production
url: ${{ steps.upload-to-cloudflare.outputs.url }}
steps:
- uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
- name: Upload to Cloudflare Pages
id: upload-to-cloudflare
uses: cloudflare/[email protected]
with:
branch: ${{ github.ref_name }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.ACCOUNT_ID }}
projectName: bayukurnia-com
directory: dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}