GET user infos #23
This file contains hidden or 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: Canfly Dev CI/CD | |
| on: | |
| pull_request: | |
| types: | |
| - closed | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' | |
| # main branch로 pr 요청되고 merge가 되면 작동 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Create .env file from secret | |
| run: | | |
| printf '%s' "${{ secrets.ENV_FILE }}" > .env | |
| chmod 600 .env | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4.0.0 | |
| with: | |
| java-version: '17' | |
| distribution: 'adopt' | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| shell: bash | |
| - name: Build with Gradle | |
| run: ./gradlew clean build -x test | |
| shell: bash | |
| - name: Get current time | |
| uses: josStorer/get-current-time@v2 | |
| id: current-time | |
| with: | |
| format: 'YYYY-MM-DDTHH:mm:ss' | |
| utcOffset: '+09:00' | |
| - name: Show current time | |
| run: echo "${{ steps.current-time.outputs.formattedTime }}" | |
| shell: bash | |
| - name: Generate deployment package | |
| run: | | |
| chmod +x .platform/hooks/predeploy/01-create-swap.sh | |
| mkdir -p deploy | |
| cp build/libs/*.jar deploy/application.jar | |
| cp Procfile deploy/Procfile | |
| cp .env deploy/.env | |
| cp -r .ebextensions_dev deploy/.ebextensions | |
| cp -r .platform deploy/.platform | |
| (cd deploy && zip -r deploy.zip .) | |
| - name: Deploy to Elastic Beanstalk | |
| uses: einaregilsson/beanstalk-deploy@v20 | |
| with: | |
| aws_access_key: ${{ secrets.AWS_ACTION_ACCESS_KEY_ID }} | |
| aws_secret_key: ${{ secrets.AWS_ACTION_SECRET_ACCESS_KEY }} | |
| application_name: 'canfly-dev' | |
| environment_name: 'Canfly-dev-env' | |
| version_label: github-action-${{ steps.current-time.outputs.formattedTime }} | |
| region: 'ap-northeast-2' | |
| deployment_package: 'deploy/deploy.zip' | |
| wait_for_deployment: false |