Skip to content

Commit 8b7b920

Browse files
committed
Deploy automático da API
1 parent 256175b commit 8b7b920

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

.github/workflows/pipeline.yaml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI/CD Pipeline
33
on: [push, pull_request]
44

55
jobs:
6-
backend-tests:
6+
tests:
77
runs-on: ubuntu-latest
88
defaults:
99
run:
@@ -30,3 +30,27 @@ jobs:
3030

3131
- name: Testes
3232
run: poetry run pytest -s -v
33+
34+
deploy:
35+
runs-on: ubuntu-latest
36+
needs: tests
37+
if: github.ref == 'refs/heads/main'
38+
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
43+
- name: Preparar pasta de deploy
44+
run: |
45+
mkdir deploy
46+
cp backend/poetry.lock deploy/
47+
cp backend/pyproject.toml deploy/
48+
cp -r backend/src deploy/
49+
ls -la deploy/
50+
51+
- name: Deploy
52+
uses: squarecloudofc/github-action@v2.0.1
53+
with:
54+
run: commit ${{ secrets.SQUARE_APPLICATION_ID }}
55+
token: '${{ secrets.SQUARE_TOKEN }}'
56+
workdir: deploy

0 commit comments

Comments
 (0)