added additional config #4
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: Exploring Variables and Secrets | ||
on: | ||
push | ||
jobs: | ||
## ENV EXAMPLE AT STEP LEVEL | ||
## docker: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Docker Build | ||
# env: | ||
# CONTAINER_REGISTRY: docker.io | ||
# DOCKER_USERNAME: siddharth1 | ||
# IMAGE_NAME: github-actions-nginx | ||
# run: echo docker build -t ${{ env.CONTAINER_REGISTRY}}/$DOCKER_USERNAME/$IMAGE_NAME:latest | ||
# - name: Docker Login | ||
# env: | ||
# DOCKER_PASSWORD: s3cUrePaSsw0rd | ||
# DOCKER_USERNAME: siddharth1 | ||
# run: docker login --username=$DOCKER_USERNAME --password=$DOCKER_PASSWORD | ||
# - name: Docker Publish | ||
# env: | ||
# CONTAINER_REGISTRY: docker.io | ||
# DOCKER_USERNAME: siddharth1 | ||
# IMAGE_NAME: github-actions-nginx | ||
# run: docker push docker.io/dockerUsername/imageName:latest | ||
# deploy: | ||
# needs: docker | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Docker Run | ||
# run: docker run -d -p 8080:80 docker.io/dockerUsername/imageName:latest | ||
## ENV EXAMPLE AT JOB LEVEL | ||
docker: | ||
env: | ||
CONTAINER_REGISTRY: docker.io | ||
DOCKER_USERNAME: siddharth1 | ||
IMAGE_NAME: github-actions-nginx | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Docker Build | ||
run: echo docker build -t $CONTAINER_REGISTRY/$DOCKER_USERNAME/$IMAGE_NAME:latest | ||
- name: Docker Login | ||
env: | ||
DOCKER_PASSWORD: s3cUrePaSsw0rd | ||
run: echo docker login --username=$DOCKER_USERNAME --password=$DOCKER_PASSWORD | ||
- name: Docker Publish | ||
run: echo docker push $CONTAINER_REGISTRY/$DOCKER_USERNAME/$IMAGE_NAME:latest | ||
deploy: | ||
env: | ||
CONTAINER_REGISTRY: docker.io | ||
DOCKER_USERNAME: siddharth1 | ||
IMAGE_NAME: github-actions-nginx | ||
needs: docker | ||
runs-on: ubuntu-latest |