Skip to content

Commit

Permalink
Merge pull request #7 from giovannism20/main
Browse files Browse the repository at this point in the history
Worflow de Deploy
  • Loading branch information
giovannism20 authored Oct 24, 2023
2 parents 49dd212 + fde7b0d commit b8e2e64
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy

on:
push:
branches: [ main ]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
# Clona o repositório.
- uses: actions/checkout@v4

# Instala PHP e Composer.
- name: Configura PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.x
tools: composer:v2

# Valida o arquivo composer.json.
- name: Valida o arquivo composer.json e o arquivo composer.lock
run: composer validate --strict

# Armazena as dependências em cache para que não seja necessário
# fazer o download a cada nova execução.
- name: Armazena pacotes Composer
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
# Instala as dependências.
- name: Instala as dependências
run: composer install --prefer-dist --no-progress

# Faz o build do site na pasta temporária.
- name: Gerar os arquivos estáticos
run: vendor/bin/jigsaw build production

# Commita os arquivos gerados no passo anterior na branch gh-pages.
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build_production
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "phprio/novo-site",
"description": "Site do grupo de usuário de PHP do Rio de Janeiro",
"license": "AGPL-3.0-or-later",
"require": {
"tightenco/jigsaw": "^1.7"
}
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b8e2e64

Please sign in to comment.