Skip to content

chore(deps-dev): Bump svelte in /frontend/galactic-sovereign-frontend #266

chore(deps-dev): Bump svelte in /frontend/galactic-sovereign-frontend

chore(deps-dev): Bump svelte in /frontend/galactic-sovereign-frontend #266

Workflow file for this run

name: Build and push services
on:
push:
paths:
- "go.mod"
- ".github/workflows/**"
- "build/**"
- "pkg/**"
- "internal/**"
- "cmd/**"
- "frontend/user-dashboard/**"
- "frontend/galactic-sovereign-frontend/**"
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs#example-only-cancel-in-progress-jobs-on-specific-branches
# https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# https://github.com/dorny/paths-filter
detect-code-changes:
runs-on: ubuntu-latest
outputs:
ci: ${{ steps.filter.outputs.ci }}
galactic-sovereign-service: ${{ steps.filter.outputs.galactic-sovereign-service }}
user-dashboard: ${{ steps.filter.outputs.user-dashboard }}
galactic-sovereign-frontend: ${{ steps.filter.outputs.galactic-sovereign-frontend }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
base: ${{ github.ref_name }}
filters: |
ci:
- '.github/workflows/build-and-push.yml'
galactic-sovereign-service:
- 'go.mod'
- 'pkg/**'
- 'internal/**'
- 'cmd/galactic-sovereign/**'
- '.github/workflows/galactic-sovereign-service**'
- 'build/galactic-sovereign-service/Dockerfile'
user-dashboard:
- 'frontend/user-dashboard/**'
- '.github/workflows/user-dashboard**'
- 'build/user-dashboard/Dockerfile'
galactic-sovereign-frontend:
- 'frontend/galactic-sovereign-frontend/**'
- '.github/workflows/galactic-sovereign-frontend-build-and-push.yml'
- 'build/galactic-sovereign-frontend/Dockerfile'
analyze-code-changes:
runs-on: ubuntu-latest
needs: [detect-code-changes]
outputs:
galactic-sovereign-service: ${{ steps.galactic-sovereign-service.outputs.rebuild }}
user-dashboard: ${{ steps.user-dashboard.outputs.rebuild }}
galactic-sovereign-frontend: ${{ steps.galactic-sovereign-frontend.outputs.rebuild }}
steps:
- name: Determine galactic-sovereign-service rebuild status
id: galactic-sovereign-service
run: |
echo 'rebuild=${{ needs.detect-code-changes.outputs.galactic-sovereign-service == 'true' || needs.detect-code-changes.outputs.ci == 'true' }}' >> $GITHUB_OUTPUT
- name: Determine user-dashboard rebuild status
id: user-dashboard
run: |
echo 'rebuild=${{ needs.detect-code-changes.outputs.user-dashboard == 'true' || needs.detect-code-changes.outputs.ci == 'true' }}' >> $GITHUB_OUTPUT
- name: Determine galactic-sovereign-frontend rebuild status
id: galactic-sovereign-frontend
run: |
echo 'rebuild=${{ needs.detect-code-changes.outputs.galactic-sovereign-frontend == 'true' || needs.detect-code-changes.outputs.ci == 'true' }}' >> $GITHUB_OUTPUT
analyze-persist-tags-status:
runs-on: ubuntu-latest
needs: [detect-code-changes, analyze-code-changes]
outputs:
persist: ${{ steps.persist-tags.outputs.persist }}
steps:
- name: Detect if service tags should be persisted
id: persist-tags
run: |
echo 'persist=${{ (github.ref == 'refs/heads/master') && (needs.analyze-code-changes.outputs.galactic-sovereign-service == 'true' || needs.analyze-code-changes.outputs.user-dashboard == 'true' || needs.analyze-code-changes.outputs.galactic-sovereign-frontend == 'true') }}' >> $GITHUB_OUTPUT
extract-service-tag:
runs-on: ubuntu-latest
# https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs
outputs:
version: ${{ steps.service-version.outputs.tag }}
steps:
- uses: actions/checkout@v4
- name: Extract git commit hash
id: service-version
# https://stackoverflow.com/questions/58886293/getting-current-branch-and-commit-hash-in-github-action
run: echo "tag=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_OUTPUT
tests:
needs: [analyze-code-changes]
if: ${{ needs.analyze-code-changes.outputs.galactic-sovereign-service == 'true' }}
uses: ./.github/workflows/galactic-sovereign-service-tests.yml
secrets:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
build-galactic-sovereign-service:
needs: [tests, extract-service-tag]
if: ${{ needs.analyze-code-changes.outputs.galactic-sovereign-service == 'true' }}
uses: ./.github/workflows/galactic-sovereign-service-build-and-push.yml
with:
service-tag: ${{ needs.extract-service-tag.outputs.version }}
secrets:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
build-user-dashboard:
needs: [analyze-code-changes, extract-service-tag]
if: ${{ needs.analyze-code-changes.outputs.user-dashboard == 'true' }}
uses: ./.github/workflows/user-dashboard-build-and-push.yml
with:
service-tag: ${{ needs.extract-service-tag.outputs.version }}
secrets:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
build-galactic-sovereign-frontend:
needs: [analyze-code-changes, extract-service-tag]
if: ${{ needs.analyze-code-changes.outputs.galactic-sovereign-frontend == 'true' }}
uses: ./.github/workflows/galactic-sovereign-frontend-build-and-push.yml
with:
service-tag: ${{ needs.extract-service-tag.outputs.version }}
secrets:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
persist-service-tags:
runs-on: ubuntu-latest
needs:
[
analyze-code-changes,
analyze-persist-tags-status,
build-galactic-sovereign-service,
build-user-dashboard,
build-galactic-sovereign-frontend,
extract-service-tag,
]
# https://github.com/actions/runner/issues/491
if: |
always() &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled') &&
github.ref == 'refs/heads/master' &&
needs.analyze-persist-tags-status.outputs.persist == 'true'
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
repository: "Knoblauchpilze/ec2-deployment"
token: ${{ secrets.DEPLOYMENT_TOKEN }}
- name: Save galactic-sovereign-service tag
if: ${{ needs.analyze-code-changes.outputs.galactic-sovereign-service == 'true' }}
run: |
echo "${{ needs.extract-service-tag.outputs.version }}" > ./build/galactic-sovereign-service/version.txt
- name: Save user-dashboard tag
if: ${{ needs.analyze-code-changes.outputs.user-dashboard == 'true' }}
run: |
echo "${{ needs.extract-service-tag.outputs.version }}" > ./build/user-dashboard/version.txt
- name: Save galactic-sovereign-frontend tag
if: ${{ needs.analyze-code-changes.outputs.galactic-sovereign-frontend == 'true' }}
run: |
echo "${{ needs.extract-service-tag.outputs.version }}" > ./build/galactic-sovereign-frontend/version.txt
- name: Commit changes
run: |
git pull
git config --global user.name 'totocorpbot'
git config --global user.email '[email protected]'
git commit -am "infra: Bumped services versions to latest revision"
git push
finish:
runs-on: ubuntu-latest
needs:
[
analyze-code-changes,
build-galactic-sovereign-service,
build-user-dashboard,
build-galactic-sovereign-frontend,
persist-service-tags,
extract-service-tag,
]
if: |
always() &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled')
steps:
- uses: actions/checkout@v4
- name: galactic-sovereign-service tag
if: ${{ needs.analyze-code-changes.outputs.galactic-sovereign-service == 'true' }}
run: |
echo "Tag is now ${{ needs.extract-service-tag.outputs.version }}"
- name: user-dashboard tag
if: ${{ needs.analyze-code-changes.outputs.user-dashboard == 'true' }}
run: |
echo "Tag is now ${{ needs.extract-service-tag.outputs.version }}"
- name: galactic-sovereign-frontend tag
if: ${{ needs.analyze-code-changes.outputs.galactic-sovereign-frontend == 'true' }}
run: |
echo "Tag is now ${{ needs.extract-service-tag.outputs.version }}"