feat: containerize tmp dir and refactor scripts #33
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: Build images | |
on: | |
pull_request: | |
paths: | |
- 'services/localega-tsd-proxy/**' | |
- 'services/mq-interceptor/**' | |
branches: | |
- main | |
jobs: | |
detect-changes: | |
runs-on: ubuntu-latest | |
outputs: | |
localega-tsd-proxy: ${{ steps.changes.outputs.localega-tsd-proxy }} | |
mq-interceptor: ${{ steps.changes.outputs.mq-interceptor }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: changes | |
with: | |
filters: | | |
localega-tsd-proxy: | |
- 'services/localega-tsd-proxy/**' | |
mq-interceptor: | |
- 'services/mq-interceptor/**' | |
localega_tsd_proxy: | |
needs: detect-changes | |
if: needs.detect-changes.outputs.localega-tsd-proxy == 'true' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Build with Gradle | |
run: ./gradlew services:localega-tsd-proxy:assemble | |
- name: Set Repository Name | |
id: repo_name | |
run: | | |
REPO_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') | |
echo "repo_name=$REPO_NAME" >> $GITHUB_ENV | |
- name: Log in to the Github Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./services/localega-tsd-proxy | |
push: true | |
no-cache: 'true' | |
tags: | | |
ghcr.io/${{ env.repo_name }}:localega-tsd-proxy-${{ github.event.number }} | |
labels: | | |
org.opencontainers.image.source=${{ github.event.repository.clone_url }} | |
org.opencontainers.image.created=$(date -u +'%Y-%m-%dT%H:%M:%SZ') | |
org.opencontainers.image.revision=${{ github.sha }} | |
mq-interceptor: | |
needs: detect-changes | |
if: needs.detect-changes.outputs.mq-interceptor == 'true' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Repository Name | |
id: repo_name | |
run: | | |
REPO_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') | |
echo "repo_name=$REPO_NAME" >> $GITHUB_ENV | |
- name: Log in to the Github Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./services/mq-interceptor | |
push: true | |
no-cache: 'true' | |
tags: | | |
ghcr.io/${{ env.repo_name }}:mq-interceptor-${{ github.event.number }} | |
labels: | | |
org.opencontainers.image.source=${{ github.event.repository.clone_url }} | |
org.opencontainers.image.created=$(date -u +'%Y-%m-%dT%H:%M:%SZ') | |
org.opencontainers.image.revision=${{ github.sha }} | |