✅ update icon #106
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: Deployment | |
on: | |
push: | |
branches: | |
- carz-merchant | |
env: | |
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | |
TELEGRAM_GROUP_ID: ${{ vars.TELEGRAM_GROUP_ID }} | |
TELEGRAM_TOPIC_ID: ${{ vars.TELEGRAM_TOPIC_ID }} | |
jobs: | |
build: | |
name: Build iconmoon | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 5 | |
steps: | |
- name: Check out Git repository (Core branch) | |
uses: actions/checkout@v4 | |
with: | |
ref: core | |
path: core | |
- name: Check out Git repository (carz-merchant branch) | |
uses: actions/checkout@v4 | |
with: | |
ref: carz-merchant | |
path: app | |
- name: Check out Git repository (gh-pages branch) | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: Send telegram message | |
uses: PacificPromise/macos-telegram-action@main | |
with: | |
type: topic | |
message: "🎬 - Start deploy icons Carz Merchant" | |
- name: Run npm install | |
run: cd core && npm install | |
- name: Run npm start | |
run: cd core && npm start | |
- name: Move carz-merchant file | |
run: rm -rf gh-pages/carz-merchant && mv core/output gh-pages/carz-merchant | |
- name: Create index file | |
run: cp gh-pages/carz-merchant/demo.html gh-pages/carz-merchant/index.html | |
- name: Setup secret id_rsa | |
env: | |
ID_RSA: ${{ secrets.ID_RSA }} | |
run: echo "$ID_RSA" > gh-pages/.key/id_rsa | |
- name: Push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
cd gh-pages | |
DIR_NAME=$(pwd) | |
chmod 400 "$DIR_NAME/.key/id_rsa" | |
export GIT_SSH_COMMAND="ssh -i $DIR_NAME/.key/id_rsa -o IdentitiesOnly=yes" | |
git config user.name "GitHub Actions" --local | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" --local | |
git remote set-url origin [email protected]:LibertyCarz/icons.git | |
git status | |
git add -A | |
git commit -m ':white_check_mark: update carz merchant icon' | |
git push origin gh-pages | |
- name: Send success telegram message | |
uses: PacificPromise/macos-telegram-action@main | |
with: | |
type: topic | |
message: "✅ - Success build icons Carz Merchant" | |
- name: Send message failure | |
if: failure() | |
uses: PacificPromise/macos-telegram-action@main | |
with: | |
type: topic | |
message: "💥 - Failure build icons Carz Merchant" |