update ci #18
Workflow file for this run
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: build app | |
on: | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build-ui: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
env: | |
NODE_ENV: production | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node 20.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
cache: npm | |
- name: "install" | |
run: npm ci --production | |
- name: "build" | |
run: npm run build | |
- name: "Check if build has changed" | |
if: success() | |
id: has-changes | |
run: | | |
echo "stdout<<EOF" >> $GITHUB_OUTPUT | |
echo "$(git diff --stat)" >> $GITHUB_OUTPUT | |
echo 'EOF' >> $GITHUB_OUTPUT | |
- name: Import GPG key | |
if: ${{ steps.has-changes.outputs.stdout }} | |
uses: crazy-max/ghaction-import-gpg@v5 | |
with: | |
gpg_private_key: ${{ secrets.GPG_BOT }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
fingerprint: "68C0468E53A658D24C0C1B612DD506482092C18E" | |
- name: "Commit files" | |
if: ${{ steps.has-changes.outputs.stdout }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh pr checkout ${{ github.event.pull_request.number }} | |
git config --local user.email "[email protected]" | |
git config --local user.name "Build action bot" | |
git commit -m "build action" -a | |
- name: "Push changes" | |
if: ${{ steps.has-changes.outputs.stdout }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: git push -u origin HEAD |