Skip to content

Commit

Permalink
add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaslangsch committed Jul 31, 2023
1 parent af1eb49 commit 89875eb
Show file tree
Hide file tree
Showing 3 changed files with 377 additions and 19 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
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, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site

- name: Set VITE_PUBLIC_KEY secret
env:
VITE_PUBLIC_KEY: ${{ secrets.VITE_PUBLIC_KEY }}
run: echo "VITE_PUBLIC_KEY=$VITE_PUBLIC_KEY" >> $GITHUB_ENV

- name: Set VITE_TOKEN_GITHUB secret
env:
VITE_TOKEN_GITHUB: ${{ secrets.VITE_TOKEN_GITHUB }}
run: echo "VITE_TOKEN_GITHUB=$VITE_TOKEN_GITHUB" >> $GITHUB_ENV

- name: Set VITE_SERVICE_ID secret
env:
VITE_SERVICE_ID: ${{ secrets.VITE_SERVICE_ID }}
run: echo "VITE_SERVICE_ID=$VITE_SERVICE_ID" >> $GITHUB_ENV

- name: Set VITE_TEMPLATE_ID secret
env:
VITE_TEMPLATE_ID: ${{ secrets.VITE_TEMPLATE_ID }}
run: echo "VITE_TEMPLATE_ID=$VITE_TEMPLATE_ID" >> $GITHUB_ENV

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: site
path: ./_site

# Deployment job
deploy:
environment:
name: github-pages
url: https://lucaslangsch.github.io/
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: site
- name: Deploy to GitHub Pages
env:
VITE_TOKEN_GITHUB: ${{ secrets.VITE_TOKEN_GITHUB }}
VITE_SERVICE_ID: ${{ secrets.VITE_SERVICE_ID }}
VITE_TEMPLATE_ID: ${{ secrets.VITE_TEMPLATE_ID }}
VITE_PUBLIC_KEY: ${{ secrets.VITE_PUBLIC_KEY }}
run: |
bundle exec jekyll build
git config --global lucaslangsch
git config --global lucas.langsch@gmail.com
git checkout gh-pages
cp -r ./_site/* .
git add .
git commit -m "Atualização do site"
git push origin gh-pages
Loading

0 comments on commit 89875eb

Please sign in to comment.