Add Social login&Board (#11) #1
Workflow file for this run
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: Deploy Production | |
# Upload Docker Image to ECR & Pull Image to Beanstalk | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
deploy: | |
name: Deploy Production | |
runs-on: ubuntu-latest | |
# https://github.com/actions/checkout#checkout-multiple-repos-private | |
# https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-token | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.PRODUCTION_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.PRODUCTION_AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Build, tag, and push image to Amazon ECR | |
id: build-image | |
env: | |
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
ECR_REPOSITORY: laravel-production | |
IMAGE_TAG: latest | |
run: | | |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . | |
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | |
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" | |
- name: Get current time | |
uses: 1466587594/get-current-time@v2 | |
id: current-time | |
with: | |
format: YYYYMMDD_HH-mm-ss | |
utcOffset: '+09:00' | |
- name: Generate production package | |
run: | | |
cd app | |
mkdir -p deploy | |
cp docker/Dockerrun-production.aws.json deploy/Dockerrun.aws.json | |
cd deploy && zip -r deploy.zip . | |
- name: Beanstalk Deploy | |
uses: einaregilsson/beanstalk-deploy@v14 | |
with: | |
aws_access_key: ${{ secrets.PRODUCTION_AWS_ACCESS_KEY_ID }} | |
aws_secret_key: ${{ secrets.PRODUCTION_AWS_SECRET_ACCESS_KEY }} | |
application_name: laravel | |
environment_name: laravel-production | |
version_label: laravel-production-${{steps.current-time.outputs.formattedTime}} | |
region: ap-northeast-2 | |
deployment_package: app/deploy/deploy.zip | |
wait_for_environment_recovery: 200 | |
- name: Slack notifications | |
uses: 8398a7/action-slack@v3 | |
with: | |
job_name: Deploy Production | |
status: ${{ job.status }} | |
author_name: Laravel production deploy | |
fields: all | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
if: always() |