Skip to content

Merge pull request #58 from Central-MakeUs/dev #14

Merge pull request #58 from Central-MakeUs/dev

Merge pull request #58 from Central-MakeUs/dev #14

Workflow file for this run

name: stage CI/CD pipeline
on:
push:
branches: [ "stage" ]
permissions:
contents: read
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create necessary directories
run: |
mkdir -p core/core-infra-rdb/src/main/resources
mkdir -p core/core-security/src/main/resources
mkdir -p core/core-infra-s3/src/main/resources
mkdir -p core/core-infra-feign/src/main/resources
mkdir -p core/core-infra-redis/src/main/resources
mkdir -p core/core-security/src/main/resources/key
- name: Create application-properties.yml
run: |
echo "${{ secrets.APPLICATION_INFRA_RDB }}" > core/core-infra-rdb/src/main/resources/application-infra-rdb.yml
echo "${{ secrets.APPLICATION_SECURITY }}" > core/core-security/src/main/resources/application-security.yml
echo "${{ secrets.APPLICATION_AWS_CLOUD }}" > core/core-infra-s3/src/main/resources/application-s3.yml
echo "${{ secrets.APPLICATION_FEIGN }}" > core/core-infra-feign/src/main/resources/application-feign.yml
echo "${{ secrets.APPLICATION_REDIS }}" > core/core-infra-redis/src/main/resources/application-redis.yml
echo "${{ secrets.APPLE_KEY }}" > core/core-security/src/main/resources/key/${{secrets.APPLE_KEY_NAME}}.p8
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: Build the Docker image
run: docker build -t ${{secrets.DOCKERHUB_REPOSITORY}}/daldal-stage:latest -f ./api/DockerFile .
- name: Docker Push
run: docker push ${{secrets.DOCKERHUB_REPOSITORY}}/daldal-stage:latest
cd:
needs: ci
runs-on: ubuntu-latest
steps:
- name: Trigger Portainer Webhook
run: |
PORTAINER_WEBHOOK_URL=${{secrets.PORTAINER_STAGE_DNS}}
curl -X POST -d "{}" -H "Content-Type: application/json" --insecure $PORTAINER_WEBHOOK_URL