Skip to content

chore: noversion

chore: noversion #8

Workflow file for this run

name: Update config
on:
push:
branches:
- main
permissions:
contents: write
jobs:
run:
name: Run ${{ matrix.env }}
environment: ${{ matrix.env }}
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: true
matrix:
include:
- env: dev
- env: stg
- env: prd
steps:
- name: Call update /api/app-config
run: |
mkdir ${{ matrix.env }}
curl -X GET ${{ vars.BASE_URL }}/api/app-config -H "Content-Type: application/json" -o ./${{ matrix.env }}/app-config.json
- name: Upload to artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.env }}-app-config
path: ${{ matrix.env }}/app-config.json
if-no-files-found: warn
after-run:
name: After run
needs: [run]
runs-on: ubuntu-latest
steps:
- name: Download from artifact
uses: actions/download-artifact@v4
- name: Checkout source
uses: actions/checkout@v4
with:
repository: ${{ secrets.STATIC_WEB_REPOSITORY }}
token: ${{ secrets.GH_PAT }}
path: source
- name: test
run: ls
# - name: Move file
# run: |
# rm -rf ./source/${{ matrix.env }}/conf/app-config.json
# mv ./tmp/app-config.json ./source/${{ matrix.env }}/conf/app-config.json
# - name: Commit
# working-directory: source
# run: |
# cat ./${{ matrix.env }}/conf/app-config.json
# git config user.name "GitHub Actions"
# git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
# git add -A
# git diff-index --quiet HEAD || git commit -m ':white_check_mark: Update'
# git pull origin main && git push origin main