-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 2 KB
/
variable-secrets.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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