Skip to content

Commit c1fa697

Browse files
authored
Merge pull request #1 from calimania/feat/deploying-by-action
Deploying with github action
2 parents b9622fc + f425031 commit c1fa697

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

.github/workflows/build.yaml

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches: [ main ]
66
push:
77
branches: [ main ]
8+
workflow_dispatch:
89

910
env:
1011
REACT_APP_STRAPI_URL: ${{ secrets.STRAPI_URL }}
@@ -34,27 +35,21 @@ jobs:
3435
- name: Build
3536
run: npm run build
3637

38+
- name: Upload artifact
39+
uses: actions/upload-pages-artifact@v3
40+
with:
41+
name: github-pages-${{ github.run_id }}
42+
path: ./build
43+
retention-days: 1
44+
3745
deploy:
3846
needs: build
39-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
4047
runs-on: ubuntu-latest
48+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
49+
environment:
50+
name: github-pages
51+
url: ${{ steps.deployment.outputs.page_url }}
4152
steps:
42-
- uses: actions/checkout@v3
43-
44-
- name: Setup Node.js
45-
uses: actions/setup-node@v3
46-
with:
47-
node-version: '18'
48-
cache: 'npm'
49-
50-
- name: Install dependencies
51-
run: npm ci
52-
53-
- name: Build
54-
run: npm run build
55-
5653
- name: Deploy to GitHub Pages
57-
uses: peaceiris/actions-gh-pages@v3
58-
with:
59-
github_token: ${{ secrets.GITHUB_TOKEN }}
60-
publish_dir: ./build
54+
id: deployment
55+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)