Continuous Deployment #108
This file contains 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: Continuous Deployment | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 7 1 * *" # Every first day on every month at 7:00 AM UTC (10:00 AM Israel time). | |
# Allow this job to clone the repo and create a page deployment | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
pull-requests: write | |
repository-projects: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout your repository using git | |
uses: actions/checkout@v3 | |
- name: Install and build website | |
uses: withastro/action@v0 | |
publish-release: | |
needs: build | |
runs-on: ubuntu-latest | |
name: Publish a release to GitHub | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Create Release π | |
uses: ridedott/release-me-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release-branches: '["main"]' | |
node-module: true | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 | |
# build-index: | |
# needs: deploy | |
# runs-on: ubuntu-latest | |
# name: Build search index and push it to Algolia | |
# steps: | |
# - name: Checkout your repository using git | |
# uses: actions/checkout@v3 | |
# - name: Install dependencies | |
# run: npm install | |
# - name: Create index file | |
# run: node index-posts.js | |
# - name: Update index.json To Algolia | |
# run: npx atomic-algolia | |
# env: | |
# ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} | |
# ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }} | |
# ALGOLIA_INDEX_NAME: index.json | |
# ALGOLIA_INDEX_FILE: ./dist/index.json |