ci: merge workflow (#1634) #180
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: Merge | ||
on: | ||
push: | ||
branches: [main] | ||
paths-ignore: | ||
- '*.md' | ||
- '.graphics/**' | ||
- '.github/**' | ||
- '!.github/workflows/merge.yml' | ||
jobs: | ||
semver: | ||
name: Semantic Version and Tag | ||
outputs: | ||
tag: ${{ steps.changelog.outputs.tag }} | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# Outputs semver as steps.id.outputs.tag | ||
- name: Conventional Changelog Update | ||
uses: TriPSs/conventional-changelog-action@v4 | ||
id: changelog | ||
with: | ||
git-branch: refs/heads/${{ github.event.repository.default_branch }} | ||
git-push: "false" | ||
github-token: ${{ github.token }} | ||
skip-commit: "true" | ||
skip-on-empty: "false" | ||
skip-version-file: "true" | ||
# Create tag and output semver | ||
- name: Create Tags | ||
run: | | ||
echo git tag ${{ steps.changelog.outputs.tag }} | ||
echo git push origin --tag | ||
# Add tag number and latest tags to PR image | ||
retags: | ||
name: Retag Images | ||
needs: [semver] | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
packages: write | ||
strategy: | ||
matrix: | ||
package: [migrations, backend, frontend] | ||
timeout-minutes: 1 | ||
steps: | ||
- uses: shrink/actions-docker-registry-tag@v3 | ||
with: | ||
registry: ghcr.io | ||
repository: ${{ github.repository }}/${{ matrix.package }} | ||
target: ${{ github.event.number }} | ||
tags: | | ||
latest | ||
${{ needs.semver.outputs.tag }} | ||
deploy-test: | ||
name: Deploy (test) | ||
uses: ./.github/workflows/.deploy.yml | ||
Check failure on line 62 in .github/workflows/merge.yml GitHub Actions / MergeInvalid workflow file
|
||
secrets: inherit | ||
with: | ||
environment: test | ||
tag: ${{ github.event.number }} | ||
target: test | ||
integration-e2e: | ||
name: Integration and E2E Tests | ||
needs: [deploy-test] | ||
uses: ./.github/workflows/.tests.yml | ||
with: | ||
target: test | ||
deploy-prod: | ||
name: Deploy (prod) | ||
needs: [integration-e2e] | ||
uses: ./.github/workflows/.deploy.yml | ||
secrets: inherit | ||
with: | ||
environment: prod | ||
tag: ${{ github.event.number }} | ||
target: prod | ||
promote: | ||
name: Promote Images | ||
needs: [deploy-prod] | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
packages: write | ||
strategy: | ||
matrix: | ||
package: [migrations, backend, frontend] | ||
timeout-minutes: 1 | ||
steps: | ||
- uses: shrink/actions-docker-registry-tag@v3 | ||
with: | ||
registry: ghcr.io | ||
repository: ${{ github.repository }}/${{ matrix.package }} | ||
target: ${{ github.event.number }} | ||
tags: prod |