Merge branch 'dev-branch' of github.com:piyushyadav1617/auth_frontend… #26
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: Docker Image CI | |
on: | |
push: | |
branches: [ "dev-branch" ] | |
pull_request: | |
branches: [ "dev-branch" ] | |
jobs: | |
deploy_dev: | |
name: Build and Deploy to Dev | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Build Docker image with secrets as build args | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_SECRET: ${{ secrets.DOCKER_SECRET }} | |
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }} | |
NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }} | |
ACCESS_KEY_ID: ${{ secrets._ACCESS_KEY_ID }} | |
S3_BUCKET: ${{ secrets._S3_BUCKET }} | |
S3_REGION: ${{ secrets._S3_REGION }} | |
SECRET_ACCESS_KEY: ${{ secrets._SECRET_ACCESS_KEY }} | |
run: | | |
# echo ${{ secrets.DOCKER_SECRET }} | docker login -u moonlightnexus --password-stdin | |
# Build the Docker image with build arguments | |
docker build \ | |
--build-arg NEXTAUTH_SECRET=${NEXTAUTH_SECRET} \ | |
--build-arg NEXTAUTH_URL=${NEXTAUTH_URL} \ | |
--build-arg ACCESS_KEY_ID=${ACCESS_KEY_ID} \ | |
--build-arg S3_BUCKET=${S3_BUCKET} \ | |
--build-arg S3_REGION=${S3_REGION} \ | |
--build-arg SECRET_ACCESS_KEY=${SECRET_ACCESS_KEY} \ | |
-t my-nextjs-app . |