Deploy (development) #402
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy (development) | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- development | |
paths-ignore: | |
- 'auto-i18n/result.csv' | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v3.8.1 | |
with: | |
node-version-file: ./.node-version | |
cache: 'yarn' | |
- name: Install deps | |
run: yarn install --frozen-lockfile --prefer-offline | |
- name: Test | |
run: yarn run test | |
- name: Generate for dev | |
run: yarn run generate:dev | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3.9.3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./dist | |
publish_branch: dev-deploy | |
ogp_build: | |
name: OGP Build | |
needs: deploy | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: dev-deploy | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
working-directory: ui-test | |
- name: Take screenshot | |
run: (python -m http.server --directory ./ 8000 &) ; python ./ui-test/ogp_screenshot.py | |
- name: Upload screenshot | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ogp | |
path: ogp | |
ogp_upload: | |
name: OGP Upload | |
needs: ogp_build | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: dev-deploy | |
- name: Download ogp images | |
uses: actions/download-artifact@v3 | |
with: | |
name: ogp | |
path: ogp | |
- name: Compress Images | |
uses: calibreapp/image-actions@main | |
with: | |
githubToken: ${{ secrets.GITHUB_TOKEN }} | |
compressOnly: true | |
- name: Commit files | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "github-actions" | |
git add ogp | |
git commit -m "Add OGP changes" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: dev-deploy |