diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index 8adf9b5a8..d5cf949ef 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -1,16 +1,9 @@ name: Config -on: - workflow_run: - workflows: [Lint] - types: [completed] - branches: [main, develop] - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} +on: workflow_call jobs: config: + if: ${{ github.ref_name == 'main' || github.ref_name == 'develop'}} name: Config Sync runs-on: ubuntu-latest steps: @@ -40,5 +33,5 @@ jobs: if: ${{ env.changes_exist == 'true' }} run: | git add --all - git commit --message "chore: Sync CI/CD Config Items" + git commit --message "chore: Sync Config [skip ci]" git push diff --git a/.github/workflows/docker-pr.yml b/.github/workflows/docker-pr.yml deleted file mode 100644 index ae0119625..000000000 --- a/.github/workflows/docker-pr.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: Docker Pull Request -on: - workflow_run: - workflows: [Config] - -jobs: - build: - uses: WatWowMap/ReactMap/.github/workflows/docker-base.yml@main diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml deleted file mode 100644 index 6a7a86edb..000000000 --- a/.github/workflows/docker-release.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: Docker Release -on: - release: - types: [prereleased, released] - -jobs: - build: - uses: WatWowMap/ReactMap/.github/workflows/docker-base.yml@main diff --git a/.github/workflows/docker-base.yml b/.github/workflows/docker.yml similarity index 89% rename from .github/workflows/docker-base.yml rename to .github/workflows/docker.yml index 277939622..a0f539a3b 100644 --- a/.github/workflows/docker-base.yml +++ b/.github/workflows/docker.yml @@ -1,10 +1,5 @@ name: Docker -on: - workflow_run: - workflows: [Config, Locales] - types: [completed] - release: - types: [prereleased, released] +on: workflow_call env: REGISTRY: ghcr.io diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 649048b9e..4c4a5cdd5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,5 +1,5 @@ name: Lint -on: [push] +on: [push, pull_request] jobs: lint: @@ -12,9 +12,9 @@ jobs: with: fetch-depth: 2 - name: Setup Node.js environment - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 cache: 'yarn' - name: Install Dependencies diff --git a/.github/workflows/locales.yml b/.github/workflows/locales.yml index be4a8c384..a41ba4a44 100644 --- a/.github/workflows/locales.yml +++ b/.github/workflows/locales.yml @@ -1,18 +1,11 @@ name: Locales -on: - workflow_run: - workflows: [Lint] - types: [completed] - branches: [main] - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} +on: workflow_call permissions: write-all jobs: locales: + if: ${{ github.ref_name == 'main' }} name: Locales Sync runs-on: ubuntu-latest steps: @@ -44,10 +37,9 @@ jobs: if: ${{ env.changes_exist == 'true' }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - HUSKY: 0 run: | git add --all - git commit --message "chore: sync locales" + git commit --message "chore: sync locales [skip ci]" git push git checkout develop git merge main diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..103acef25 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,12 @@ +name: Main CI +on: [push, pull_request] + +jobs: + config: + uses: ./.github/workflows/config.yml + locales: + uses: ./.github/workflows/locales.yml + release: + uses: ./.github/workflows/release.yml + docker: + uses: ./.github/workflows/docker.yml diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml deleted file mode 100644 index cc597924e..000000000 --- a/.github/workflows/release-develop.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Release Develop - -on: - workflow_run: - workflows: [Config] - types: [completed] - branches: [develop] - -jobs: - build: - uses: WatWowMap/ReactMap/.github/workflows/release-base.yml@develop diff --git a/.github/workflows/release-main.yml b/.github/workflows/release-main.yml deleted file mode 100644 index a3461a28c..000000000 --- a/.github/workflows/release-main.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Release Main - -on: - workflow_run: - workflows: [Locales] - types: [completed] - branches: [main] - -jobs: - build: - uses: WatWowMap/ReactMap/.github/workflows/release-base.yml@main diff --git a/.github/workflows/release-base.yml b/.github/workflows/release.yml similarity index 90% rename from .github/workflows/release-base.yml rename to .github/workflows/release.yml index 7284c0ac4..dd99f8f25 100644 --- a/.github/workflows/release-base.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,7 @@ permissions: write-all jobs: release: + if: ${{ github.ref_name == 'main' || github.ref_name == 'develop'}} name: GitHub Release runs-on: ubuntu-latest steps: diff --git a/.github/workflows/sentry.yml b/.github/workflows/sentry.yml index 556580bfe..7f783e5e1 100644 --- a/.github/workflows/sentry.yml +++ b/.github/workflows/sentry.yml @@ -1,7 +1,7 @@ name: Sentry on: release: - types: [prereleased, released] + types: [published] jobs: sentry: