Skip to content

Commit 79c54d4

Browse files
committed
Deploy from GitHub Actions directly
1 parent b5b04a1 commit 79c54d4

File tree

2 files changed

+35
-29
lines changed

2 files changed

+35
-29
lines changed

.github/actions/setup/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ runs:
55
using: composite
66
steps:
77
- name: Setup Node.js
8-
uses: actions/setup-node@v3
8+
uses: actions/setup-node@v4
99
with:
1010
node-version-file: .nvmrc
1111

1212
- name: Cache dependencies
1313
id: yarn-cache
14-
uses: actions/cache@v3
14+
uses: actions/cache@v4
1515
with:
1616
path: |
1717
**/node_modules

.github/workflows/main.yml

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,50 @@ on:
66
branches:
77
- main
88

9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: false
17+
918
jobs:
10-
deploy:
11-
name: Deploy to Github Pages
19+
build:
20+
name: Build
1221
runs-on: ubuntu-latest
1322

1423
steps:
1524
- name: Checkout
16-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
1726

1827
- name: Setup
1928
uses: ./.github/actions/setup
2029

21-
# - name: Use crowdin
22-
# run: |
23-
# wget -c https://artifacts.crowdin.com/repo/deb/crowdin.deb -O crowdin.deb
24-
# sudo dpkg -i crowdin.deb
25-
26-
# - name: Sync with crowdin
27-
# env:
28-
# CROWDIN_DOCUSAURUS_PROJECT_ID: react-navigation
29-
# CROWDIN_DOCUSAURUS_API_KEY: ${{ secrets.CROWDIN_DOCUSAURUS_API_KEY }}
30-
# run: |
31-
# yarn crowdin-upload
32-
# yarn crowdin-download
33-
3430
- name: Update sponsors list
3531
env:
3632
GITHUB_TOKEN: ${{ secrets.DEPLOY_GITHUB_TOKEN }}
3733
run: yarn fetch-sponsors
3834

39-
- name: Publish to Github pages
40-
env:
41-
GITHUB_TOKEN: ${{ secrets.DEPLOY_GITHUB_TOKEN }}
42-
GITHUB_EMAIL: ${{ secrets.DEPLOY_GITHUB_EMAIL }}
43-
GIT_USER: ${{ secrets.DEPLOY_GITHUB_USER }}
44-
CURRENT_BRANCH: $GITHUB_REF
45-
run: |
46-
git config --global user.email "$GITHUB_EMAIL"
47-
git config --global user.name "$GITHUB_ACTOR"
48-
echo "machine github.com login $GIT_USER password $GITHUB_TOKEN" > ~/.netrc
49-
yarn deploy
35+
- name: Build
36+
run: yarn build
37+
38+
- name: Upload artifact
39+
uses: actions/upload-pages-artifact@v3
40+
with:
41+
path: build
42+
43+
deploy:
44+
name: Deploy to GitHub Pages
45+
needs: build
46+
runs-on: ubuntu-latest
47+
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
52+
steps:
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)